Skip to content

Commit

Permalink
Remove nose from conda build and eliminate last remaining doctest (#537)
Browse files Browse the repository at this point in the history
  • Loading branch information
maximlt authored Oct 2, 2021
1 parent b3a5c44 commit 9682909
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
4 changes: 2 additions & 2 deletions conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ test:
- param
- numbergen
commands:
# https://github.com/ioam/param/issues/219
- nosetests tests
# https://github.com/holoviz/param/issues/219
- pytest tests

about:
home: {{ sdata['url'] }}
Expand Down
2 changes: 0 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,3 @@ ignore = E114,

[tool:pytest]
python_files = test*.py
# Run the doctests found (if any) in the modules of param & numbergen.
addopts = --doctest-modules param numbergen
20 changes: 20 additions & 0 deletions tests/API1/testtimedependent.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,26 @@ def test_time_int_change_type(self):
self.assertEqual(t(), 1)
self.assertEqual(t.time_type, fractions.Fraction)

def test_time_integration(self):
# This used to be a doctest of param.Time; moved
# here not to have any doctest to run.
time = param.Time(until=20, timestep=1)
self.assertEqual(time(), 0)
self.assertEqual(time(5), 5)
time += 5
self.assertEqual(time(), 10)
with time as t:
self.assertEqual(t(), 10)
self.assertEqual(
[val for val in t],
[10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
)
self.assertEqual(t(), 20)
'Time after iteration: %s' % t()
t += 2
self.assertEqual(t(), 22)
self.assertEqual(time(), 10)

@pytest.mark.skipif(gmpy is None, reason="gmpy is not installed")
def test_time_init_gmpy(self):
t = param.Time(time_type=gmpy.mpq)
Expand Down

0 comments on commit 9682909

Please sign in to comment.