improvements for PR #355

This commit is contained in:
Moritz Raabe
2020-11-09 13:39:19 +01:00
parent 75defc13a0
commit dfc805b89b
2 changed files with 6 additions and 6 deletions

View File

@@ -458,12 +458,10 @@ def main(argv=None):
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
description=desc, epilog=epilog, formatter_class=argparse.RawDescriptionHelpFormatter description=desc, epilog=epilog, formatter_class=argparse.RawDescriptionHelpFormatter
) )
# TODO: decode won't work for python3
if sys.version_info >= (3, 0): if sys.version_info >= (3, 0):
parser.add_argument( parser.add_argument(
# in #328 we noticed that the sample path is not handled correctly if it contains non-ASCII characters # Python 3 str handles non-ASCII arguments correctly
# https://stackoverflow.com/a/22947334/ offers a solution and decoding using getfilesystemencoding works
# in our testing, however other sources suggest `sys.stdin.encoding` (https://stackoverflow.com/q/4012571/)
"sample", "sample",
type=str, type=str,
help="path to sample to analyze", help="path to sample to analyze",

View File

@@ -16,6 +16,7 @@ from fixtures import *
indirect=["sample", "scope"], indirect=["sample", "scope"],
) )
def test_smda_features(sample, scope, feature, expected): def test_smda_features(sample, scope, feature, expected):
with xfail(sys.version_info < (3, 0), reason="SMDA only works on py3"):
do_test_feature_presence(get_smda_extractor, sample, scope, feature, expected) do_test_feature_presence(get_smda_extractor, sample, scope, feature, expected)
@@ -25,4 +26,5 @@ def test_smda_features(sample, scope, feature, expected):
indirect=["sample", "scope"], indirect=["sample", "scope"],
) )
def test_smda_feature_counts(sample, scope, feature, expected): def test_smda_feature_counts(sample, scope, feature, expected):
with xfail(sys.version_info < (3, 0), reason="SMDA only works on py3"):
do_test_feature_count(get_smda_extractor, sample, scope, feature, expected) do_test_feature_count(get_smda_extractor, sample, scope, feature, expected)