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

Fix conda build #537

Merged
merged 3 commits into from
Oct 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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