-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Use tmp_path pytest fixture over tmpdir (#2384)
* Use `tmp_path` over `tmpdir`. * Use pathlib.Path functions now that paths and not files are being used. - Remove use of `.strpath`. - Update from `.join` to `.joinpath`. - For `json.loads` update from `.read` to `.read_text`. - For `json.load` update to use `.open`. - Update from `.write` to `.write_text` for patches. - Update from `.mkdir` to creating the path and then calling `.mkdir`.
- Loading branch information
1 parent
f78442a
commit a1a31f1
Showing
6 changed files
with
223 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import shlex | ||
|
||
|
||
def test_2bin_1channel(tmpdir, script_runner): | ||
def test_2bin_1channel(tmp_path, script_runner): | ||
command = f"pyhf inspect {'docs/examples/json/2-bin_1-channel.json':s}" | ||
ret = script_runner.run(shlex.split(command)) | ||
assert ret.success |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.