Skip to content
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

Using tmp as pwd in pytests #1068

Merged
merged 3 commits into from
Aug 13, 2024
Merged

Using tmp as pwd in pytests #1068

merged 3 commits into from
Aug 13, 2024

Conversation

mmatera
Copy link
Contributor

@mmatera mmatera commented Aug 13, 2024

As General Peron said, "Better than saying is doing". This is what I was talking about in #1067.
Also, I improved some docstrings a little bit.

@@ -102,6 +102,8 @@ def test_close():
@pytest.mark.parametrize(
("str_expr", "msgs", "str_expected", "fail_msg"),
[
(None, None, None, None), # Reset the session and set the working
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not obvious to me why this should work. Couldn't this be done as test setup instead?

Base automatically changed from one-more-test-pollution-fix to master August 13, 2024 10:54
@rocky rocky merged commit 114f4bb into master Aug 13, 2024
7 checks passed
@rocky rocky deleted the using_tmp_as_pwd_in_pytests branch August 13, 2024 10:55
@rocky
Copy link
Member

rocky commented Aug 13, 2024

Also note that there are ways to run something per test suite or test module as well. (I don't know the exact syntax though.)

converted into a Python string. Otherwise, the expression is kept
as an Expression object.
If this argument is set to ``None``, the session is reset.
str_expr: The expression to be tested. If its value is ``None``, the session is
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rocky, when you call a None test, this function calls reset_session, and this is why it works.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is convoluted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants