Closed eumiro closed 3 years ago
It's been years for me haha 😅
Looking at the function name I guess the 2 tests are identical except for how they pass the file argument to the destream class. Probably at some point one was using a filename instead of a file object. It has to work for both (if that still exists in the API).
But don't take my word for it, try to use git blame on the file and see if they ever were different.
Why convert to pytest at all?
The syntax with assert
instead of self.assert*
is nicer and more intuitive, the fixtures and parametrization makes the code more readable.
And it looks like touching the whole test codebase could show up some issues like this one :-)
I do prefer py.test too! I'm not sure it even existed when this project started.
Overall it's a nice improvement as it is easier to get in the code.
And in the meantime it even dropped the dot from py.test
to pytest
. Okay, let me see what we can do. :-)
But first, #22 needs to be reviewed/approved/merged.
Fair enough!
Why didn't this get closed with #27?
It's because you need to write "Closes #21 " or "Fixes #21" in the commit message
Does it have to be a commit message? I remember closing issues with PR messages like this one from our PR that I expected to close this issue: https://github.com/destream-py/destream/pull/27#issuecomment-760183835
Pretty sure (80%) it has to be in the commit message or the title of the commit (which is actually part of the message).
Some words also don't close the linked issue. For instance: "Related #21" will link but not close when the PR gets merged.
Found it: in the PR number 19 I wrote Closes
and the number 17 into the PR message. It even highlighted the word Closes
. So maybe this has to be in the initial message (description) of a PR and not in a comment. :shrug:
During the attempt to convert the test suite to PyTest, I have discovered, that the two tests:
test_10_passing_file_object
test_20_passing_filename
from
https://github.com/destream-py/destream/blob/00f9fab6b0fc4b837aa802336f6c6984e28595ae/tests/test_10_base.py#L50-L64
were identical. What should be the difference between them, @cecton ?