-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delay os.getcwd() call to function body #243
Changes from all commits
32f60d6
deadea0
2f5f46a
5679f66
83e1eea
a74dd73
ddcc213
e33653d
cb1ffd9
c879b00
eef1d13
7ba3449
34c3b85
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
### Enhancements | ||
|
||
* <news item> | ||
|
||
### Bug fixes | ||
|
||
* Delay ``os.getcwd()`` call to body of ``CondaFormat_v2.create()`` when | ||
``out_folder`` is not passed. (#205) | ||
|
||
### Deprecations | ||
|
||
* <news item> | ||
|
||
### Docs | ||
|
||
* <news item> | ||
|
||
### Other | ||
|
||
* <news item> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,18 +2,3 @@ | |
max-line-length = 100 | ||
ignore = E122,E123,E126,E127,E128,E731,E722 | ||
exclude = build,src/conda_package_handling/_version.py,tests,conda.recipe,.git,versioneer.py,benchmarks,.asv,rever | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. old n' busted |
||
[tool:pytest] | ||
norecursedirs= .* *.egg* build dist conda.recipe | ||
addopts = | ||
--junitxml=junit.xml | ||
--ignore setup.py | ||
--ignore run_test.py | ||
--cov-report term-missing | ||
--tb native | ||
--strict-markers | ||
--durations=20 | ||
env = | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. avoid pytest-env requirement |
||
PYTHONHASHSEED=0 | ||
markers = | ||
serial: execute test serially (to avoid race conditions) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,14 +13,23 @@ def test_cli(tmpdir, mocker): | |
Code coverage for the cli. | ||
""" | ||
for command in [ | ||
["x", str(Path(data_dir, test_package_name + ".tar.bz2")), f"--prefix={tmpdir}"], | ||
[ | ||
"x", | ||
str(Path(data_dir, test_package_name + ".tar.bz2")), | ||
f"--prefix={tmpdir}", | ||
], | ||
[ | ||
"x", | ||
str(Path(data_dir, test_package_name + ".conda")), | ||
"--info", | ||
f"--prefix={tmpdir}", | ||
], | ||
["c", str(Path(tmpdir, test_package_name)), ".tar.bz2", f"--out-folder={tmpdir}"], | ||
[ | ||
"c", | ||
str(Path(tmpdir, test_package_name)), | ||
".tar.bz2", | ||
f"--out-folder={tmpdir}", | ||
], | ||
]: | ||
cli.main(args=command) | ||
|
||
|
@@ -29,7 +38,8 @@ def test_cli(tmpdir, mocker): | |
# returning errors. Designed for .tar.bz2 -> .conda conversions that somehow | ||
# omit files? | ||
mocker.patch( | ||
"conda_package_handling.api.transmute", return_value=set("that is why you fail".split()) | ||
"conda_package_handling.api.transmute", | ||
return_value=set("that is why you fail".split()), | ||
) | ||
with pytest.raises(SystemExit): | ||
command = [ | ||
|
@@ -55,6 +65,20 @@ def test_import_main(): | |
) | ||
def test_list(artifact, n_files, capsys): | ||
"Integration test to ensure `cph list` works correctly." | ||
cli.main(["list", os.path.join(data_dir, artifact)]) | ||
cli.main(["list", os.path.relpath(os.path.join(data_dir, artifact), os.getcwd())]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. code coverage for "is path relative? call abspath()" in list code |
||
stdout, stderr = capsys.readouterr() | ||
assert n_files == sum(bool(line.strip()) for line in stdout.splitlines()) | ||
|
||
# test verbose flag | ||
cli.main( | ||
[ | ||
"list", | ||
"--verbose", | ||
os.path.join(data_dir, artifact), | ||
] | ||
) | ||
stdout, stderr = capsys.readouterr() | ||
assert n_files == sum(bool(line.strip()) for line in stdout.splitlines()) | ||
|
||
with pytest.raises(ValueError): | ||
cli.main(["list", "setup.py"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new hotness