-
Notifications
You must be signed in to change notification settings - Fork 823
Port lib/test_util.py to pytest #1413
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
Changes from all commits
b88dc82
46e2a0c
6d8816d
9798e7a
1140018
8ed78d0
6437b95
c3cc804
d8a7ba9
a345f00
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,8 @@ | |
| # | ||
| from __future__ import absolute_import, division | ||
|
|
||
| from unittest import TestCase | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is using (I know that it also supports running
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I missed that somehow! I'll read more about this and try to get rid of |
||
|
|
||
| from six.moves import range, StringIO | ||
| import six | ||
|
|
||
|
|
@@ -124,7 +126,7 @@ def test_strings(self): | |
| assert_equal(util.iterable(u"unicode string"), False) | ||
|
|
||
|
|
||
| class TestFilename(object): | ||
| class TestFilename(TestCase): | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are using
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, I'm using it because only classes that inherit from
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So we need this for a swift conversion and then remove it one by one again later. check |
||
| def setUp(self): | ||
| self.root = "foo" | ||
| self.filename = "foo.psf" | ||
|
|
@@ -161,7 +163,7 @@ def testNamedStream(self): | |
| assert_equal(ns.name, self.filename2) | ||
|
|
||
|
|
||
| class TestGeometryFunctions(object): | ||
| class TestGeometryFunctions(TestCase): | ||
| def setUp(self): | ||
| self.e1 = np.array([1., 0, 0]) | ||
| self.e2 = np.array([0, 1., 0]) | ||
|
|
@@ -230,7 +232,7 @@ def testDihedral(self): | |
| cd = bc + self.e3 | ||
| assert_almost_equal(mdamath.dihedral(ab, bc, cd), -np.pi / 2) | ||
|
|
||
| class TestMakeWhole(object): | ||
| class TestMakeWhole(TestCase): | ||
| """Set up a simple system: | ||
|
|
||
| +-----------+ | ||
|
|
@@ -442,7 +444,7 @@ def _fill_cache(self, name, value): | |
| self._cache[name] = value | ||
|
|
||
|
|
||
| class TestCachedDecorator(object): | ||
| class TestCachedDecorator(TestCase): | ||
| def setUp(self): | ||
| self.obj = Class_with_Caches() | ||
|
|
||
|
|
@@ -895,7 +897,7 @@ def test_blocks_of_VE(self): | |
| assert_raises(ValueError, util.blocks_of, arr, 2, 1) | ||
|
|
||
|
|
||
| class TestNamespace(object): | ||
| class TestNamespace(TestCase): | ||
| def setUp(self): | ||
| self.ns = util.Namespace() | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the version pinning?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conda already says that it has pytest installed and still it did not work. Also, the version it has is 2.7, so there has been a major release after that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be able to do
conda upgrade pytest?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@richardjgowers after the
source ci-helpers/travis/setup_conda.shstep?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the older version comes from astropy. They specifically install an older version of pytest for themselves. Leave the pinning for now. I'm asking what they use as a preferred way to use a newer pytest version.