Skip to content

Commit

Permalink
Adopt lastest cmdy
Browse files Browse the repository at this point in the history
  • Loading branch information
pwwang committed Jun 6, 2020
1 parent 8bffcf4 commit efc1259
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
12 changes: 11 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,19 @@ function-naming-style=snake_case
good-names=i,
j,
k,
x,
y,
z,
np,
nn,
t,
t0,
ex,
rc,
eq,
do,
by,
tf,
Run,
_

Expand Down Expand Up @@ -498,7 +508,7 @@ max-attributes=7
max-bool-expr=5

# Maximum number of branch for function / method body.
max-branches=12
max-branches=15

# Maximum number of locals for function / method body.
max-locals=15
Expand Down
10 changes: 6 additions & 4 deletions tests/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
def vcffile(tmp_path):
ovcf = HERE.parent.joinpath('examples', 'sample.vcf')
nvcf = tmp_path.with_suffix('.vcf.gz')
c = cmdy.bgzip(ovcf, c = True, _out = nvcf)
cmdy.tabix(p = 'vcf', _ = nvcf, _fg = True)
c = cmdy.bgzip(ovcf, c=True).r > nvcf
cmdy.tabix(p='vcf', _=nvcf).fg
return nvcf

def test_get_vcf_by_regions(vcffile):
Expand Down Expand Up @@ -82,7 +82,7 @@ def test_load_config(tmp_path):

def test_main(vcffile, tmp_path):
# help
cmd = cmdy.vcfstats(_raise = False)
cmd = cmdy.vcfstats(_raise=False)
assert 'Show help message and exit.' in cmd.stderr

macrofile = tmp_path.with_suffix('.macromain.py')
Expand All @@ -93,7 +93,9 @@ def DEMO(variant):
'''Some demo macro'''
return variant.CHROM
""")
cmd = cmdy.vcfstats(l = True, macro = macrofile, _raise = False)
cmd = cmdy.vcfstats(vcf=True, l=True,
o=True, f=True, t=True,
macro=macrofile, _raise=False)
assert 'Return 1 for a variant' in cmd.stderr
assert 'Some demo macro' in cmd.stderr

Expand Down

0 comments on commit efc1259

Please sign in to comment.