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

DM-3904: Pytest updates #40

Merged
merged 46 commits into from Aug 17, 2016
Merged

DM-3904: Pytest updates #40

merged 46 commits into from Aug 17, 2016

Conversation

timj
Copy link
Member

@timj timj commented Aug 15, 2016

No description provided.

Group imports in the standard way.
Put all imports at the top.
If only a few symbols imported, import them explicitly
Spell out lsst.utils.tests instead of using utilsTests
Set up an environment variable in setUpClass instead of globally
Replace "if __name__ == "__main__" with the standard replacement
Modernize the way the test is run.
Use "with assertRaises(...):" instead of "self.assertRaises(...)"

if __name__ == "__main__":
run(True)
lsst.utils.tests.init()
unittest.main()
Copy link
Member Author

Choose a reason for hiding this comment

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

newline is missing.

@r-owen r-owen force-pushed the tickets/DM-3904 branch 3 times, most recently from 154acf6 to 3de6a57 Compare August 16, 2016 01:04
print >> fd, s.getId(), s.getXAstrom(), s.getYAstrom(), s.getRa(), s.getDec(), s.getPsfFlux(), s.getFlagForDetection()
print >> fd, s.getId(), s.getXAstrom(), s.getYAstrom(), s.getRa(
), s.getDec(), s.getPsfFlux(), s.getFlagForDetection()

Copy link

Choose a reason for hiding this comment

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

I don't know that this block is more readable autopep8...

Copy link
Member Author

Choose a reason for hiding this comment

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

No. It broke at the wrong place and it probably didn't need to break at all for 110 character limit.

r-owen and others added 25 commits August 16, 2016 17:21
Modernize the way the test is run.
Only have the classes that need to be run inherit from TestCase
Change assertTrue(foo in bar) with assertIn(foo, bar)
Import lsst.utils.tests without namespace abbreviation
Use from foo import bar when only a few symbols imported
Change "self.assertRaises..." to "with self.assertRaises..."
Standardize the way ASTROMETRY_NET_DATA_DIR is set by tests,
and make sure it is always done in setUp
@r-owen r-owen merged commit 50f45d8 into master Aug 17, 2016
@ktlim ktlim deleted the tickets/DM-3904 branch August 25, 2018 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants