-
Notifications
You must be signed in to change notification settings - Fork 1
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
Allow tests to be marked as requiring a system/platform/etc pattern file suffix #22
Labels
Comments
zaufi
changed the title
Allow tests being marked as requires a system/platform/etc pattern file suffix
Allow tests to be marked as requiring a system/platform/etc pattern file suffix
Mar 1, 2024
Actually, it could be almost anything: @pytest.mark.expect_suffix(
suffix=platform.system()
)
def system_specific_test(capfd, expected_out):
...
stdout, _ = capfd.readouterr()
# Get content from `<base-dir>/.../system_specific-Linux.out`
assert expected_out == stdout
@pytest.mark.expect_suffix(
suffix=f'py{sys.version_info.major}.{sys.version_info.minor}'
)
def python_specific_test(capfd, expected_out):
...
stdout, _ = capfd.readouterr()
# Get content from `<base-dir>/.../python_specific_test-py3.12.out`
assert expected_out == stdout |
@xymaxim Ping ;-) |
zaufi
added a commit
that referenced
this issue
Mar 1, 2024
A test can be marked with `@pytest.mark.expect_suffix([args..., suffix=<arg>])` to have an arbitrary suffix in the pattern filenames. The `pm-pattern-file-fmt` format string should have the `{suffix}` placeholder to make it work.
I like how it's flexible! |
zaufi
added a commit
that referenced
this issue
Mar 1, 2024
A test can be marked with `@pytest.mark.expect_suffix([args..., suffix=<arg>])` to have an arbitrary suffix in the pattern filenames. The `pm-pattern-file-fmt` format string should have the `{suffix}` placeholder to make it work.
zaufi
added a commit
that referenced
this issue
Mar 2, 2024
A test can be marked with `@pytest.mark.expect_suffix([args..., suffix=<arg>])` to have an arbitrary suffix in the pattern filenames. The `pm-pattern-file-fmt` format string should have the `{suffix}` placeholder to make it work.
zaufi
added a commit
that referenced
this issue
Mar 2, 2024
A test can be marked with `@pytest.mark.expect_suffix([args..., suffix=<arg>])` to have an arbitrary suffix in the pattern filenames. The `pm-pattern-file-fmt` format string should have the `{suffix}` placeholder to make it work.
Implemented in PR #23 |
zaufi
added a commit
that referenced
this issue
Mar 2, 2024
A test can be marked with `@pytest.mark.expect_suffix([args..., suffix=<arg>])` to have an arbitrary suffix in the pattern filenames. The `pm-pattern-file-fmt` format string should have the `{suffix}` placeholder to make it work.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I.e., in the situation when some (not all!) pattern files have some system-specific content (e.g., different EOL styles).
Smth like this:
The text was updated successfully, but these errors were encountered: