Skip to content

Prefer pytest-style tests (issue #861) - #1862

Merged
bsipocz merged 7 commits into
astropy:masterfrom
mfonism:fix-861
Nov 1, 2020
Merged

bsipocz merged 7 commits into
astropy:masterfrom
mfonism:fix-861

Conversation

@mfonism

@mfonism mfonism commented Oct 17, 2020

Copy link
Copy Markdown
Member

This PR converts xunit-style style tests to pytest-style tests as per issue #861

@mfonism mfonism changed the title Prefer pytest-style tests (issue #861) WIP: Prefer pytest-style tests (issue #861) Oct 17, 2020
@codecov

codecov Bot commented Oct 17, 2020 •

Copy link
Copy Markdown

Codecov Report

Merging #1862 into master will decrease coverage by 0.00%.
The diff coverage is 22.41%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1862      +/-   ##
==========================================
- Coverage   64.44%   64.44%   -0.01%     
==========================================
  Files         200      200              
  Lines       16033    15962      -71     
==========================================
- Hits        10333    10287      -46     
+ Misses       5700     5675      -25     
Impacted Files Coverage Δ
astroquery/utils/commons.py 77.00% <0.00%> (ø)
astroquery/utils/decorators.py 11.11% <0.00%> (-0.98%) ⬇️
astroquery/utils/tap/gui/login.py 24.46% <0.00%> (ø)
astroquery/utils/tap/model/group.py 28.57% <0.00%> (ø)
astroquery/utils/tap/model/shared_item.py 33.33% <0.00%> (ø)
astroquery/utils/tap/model/shared_to_item.py 44.44% <0.00%> (ø)
astroquery/utils/tap/model/tapcolumn.py 92.85% <0.00%> (ø)
astroquery/utils/tap/model/user.py 50.00% <0.00%> (ø)
astroquery/utils/tap/core.py 41.21% <17.77%> (ø)
astroquery/utils/download_file_list.py 20.96% <20.00%> (ø)
... and 40 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e7ea01c...2bc3e44. Read the comment docs.

@mfonism

mfonism commented Oct 17, 2020

Copy link
Copy Markdown
Member Author

@bsipocz @ceb8 Can you please add a milestone to this so I can add a changelog for the work done.

@ceb8 ceb8 added this to the v0.4.2 milestone Oct 19, 2020
@mfonism mfonism changed the title WIP: Prefer pytest-style tests (issue #861) Prefer pytest-style tests (issue #861) Oct 19, 2020
@bsipocz

bsipocz commented Oct 19, 2020

Copy link
Copy Markdown
Member

Thank you @mfonism. Overall looks good, but this will need careful review which would take a bit of a time.

@ceb8 ceb8 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me. I had one suggestion about cleaning up strings but all the functionality looks good.

Comment on lines +44 to +45
hostUrl = host + ":" + str(connPort) + "/" + serverContext + "/" \
+ tapContext + "/"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

While you're updating these tests, let's also switch these to formatted strings. I.e. "{}:{}/{}/{}".format(host, connPort, serverContext, tapContext).

This goes for all the other similar stings in this file.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would even suggest to use fstrings, those are even easier to read.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oooh, yes! I forgot our earliest supported python version has those.
F-strings are the best: f"{host}:{connPort}/{serverContext}/{tapContext}"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done in 2bc3e44

@mfonism
mfonism requested a review from ceb8 October 25, 2020 13:38
@bsipocz bsipocz added hacktoberfest-accepted temporary label to make PRs eligible and removed to review labels Nov 1, 2020

@bsipocz bsipocz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I've reviewed the last commit about the strings, and will use the previous approval for the test refactor for merging.

@bsipocz

bsipocz commented Nov 1, 2020

Copy link
Copy Markdown
Member

Oh, wow, you changed all the strings 🎉

@bsipocz

bsipocz commented Nov 1, 2020

Copy link
Copy Markdown
Member

So, this is a massive diff, I gave a review for the string changes and didn't spot any issues. And @ceb8 has already approved the test refactors. So this is ready to go now.
(I've also confirmed that the remote tests in all affected modules still pass, once rebased to get the recent changes to esasky)

@bsipocz
bsipocz merged commit 9caa176 into astropy:master Nov 1, 2020
@bsipocz

bsipocz commented Nov 1, 2020

Copy link
Copy Markdown
Member

Massive thank you @mfonism!

@mfonism

mfonism commented Nov 1, 2020

Copy link
Copy Markdown
Member Author

Thank you @bsipocz and @ceb8. It's a pleasure getting such warm and kind feedback from you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants