Skip to content

Commit 6a8485c

Browse files
committed
remove nose from test_tools.py
1 parent 47f76d4 commit 6a8485c

1 file changed

Lines changed: 25 additions & 33 deletions

File tree

‎openpathsampling/tests/test_tools.py‎

Lines changed: 25 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import pytest
2-
from nose.tools import assert_equal
32
from openpathsampling.tools import *
43

54
import tempfile
@@ -16,48 +15,41 @@
1615

1716
def test_pretty_print_seconds():
1817
# test the basics with full reporting
19-
assert_equal(pretty_print_seconds(93784),
20-
"1 day 2 hours 3 minutes 4 seconds")
21-
assert_equal(pretty_print_seconds(179990),
22-
"2 days 1 hour 59 minutes 50 seconds")
23-
assert_equal(pretty_print_seconds(31),
24-
"31 seconds")
18+
assert pretty_print_seconds(93784) == "1 day 2 hours 3 minutes 4 seconds"
19+
assert (pretty_print_seconds(179990) ==
20+
"2 days 1 hour 59 minutes 50 seconds")
21+
assert pretty_print_seconds(31) == "31 seconds"
2522

2623
# test positive n_labels (including testing rounding)
27-
assert_equal(pretty_print_seconds(93784, n_labels=2),
28-
"1 day 2 hours")
29-
assert_equal(pretty_print_seconds(179990, n_labels=2),
30-
"2 days 2 hours")
31-
assert_equal(pretty_print_seconds(179990, n_labels=3),
32-
"2 days 2 hours 0 minutes")
33-
assert_equal(pretty_print_seconds(31, n_labels=2),
34-
"31 seconds")
24+
assert pretty_print_seconds(93784, n_labels=2) == "1 day 2 hours"
25+
assert pretty_print_seconds(179990, n_labels=2) == "2 days 2 hours"
26+
assert (pretty_print_seconds(179990, n_labels=3) ==
27+
"2 days 2 hours 0 minutes")
28+
assert pretty_print_seconds(31, n_labels=2) == "31 seconds"
3529

3630
# test negative n_labels
37-
assert_equal(pretty_print_seconds(93784, n_labels=-1),
38-
"1.09 days")
39-
assert_equal(pretty_print_seconds(93784, n_labels=-2),
40-
"1 day 2.05 hours")
41-
assert_equal(pretty_print_seconds(31, n_labels=-2),
42-
"31 seconds")
31+
assert pretty_print_seconds(93784, n_labels=-1) == "1.09 days"
32+
assert pretty_print_seconds(93784, n_labels=-2) == "1 day 2.05 hours"
33+
assert pretty_print_seconds(31, n_labels=-2) == "31 seconds"
4334

4435
# test separators
45-
assert_equal(pretty_print_seconds(93784, separator=", "),
46-
"1 day, 2 hours, 3 minutes, 4 seconds")
36+
assert (pretty_print_seconds(93784, separator=", ") ==
37+
"1 day, 2 hours, 3 minutes, 4 seconds")
4738

4839

4940
def test_progress_string():
50-
assert_equal(progress_string(0, 100, 10),
51-
"Starting simulation...\nWorking on first step\n")
52-
assert_equal(progress_string(1, 11, 9378.4),
53-
"Running for 2 hours 36 minutes 18 seconds - "
54-
+ "9378.40 seconds per step\n"
55-
+ "Estimated time remaining: 1 day 2.05 hours\n")
41+
assert (progress_string(0, 100, 10) ==
42+
"Starting simulation...\nWorking on first step\n")
43+
assert (progress_string(1, 11, 9378.4) ==
44+
"Running for 2 hours 36 minutes 18 seconds - "
45+
"9378.40 seconds per step\n"
46+
"Estimated time remaining: 1 day 2.05 hours\n")
47+
5648
# Override time_per_step
57-
assert_equal(progress_string(1, 11, 9378.4, 10),
58-
"Running for 2 hours 36 minutes 18 seconds - "
59-
+ "10.00 seconds per step\n"
60-
+ "Estimated time remaining: 1 minute 40 seconds\n")
49+
assert (progress_string(1, 11, 9378.4, 10) ==
50+
"Running for 2 hours 36 minutes 18 seconds - "
51+
"10.00 seconds per step\n"
52+
"Estimated time remaining: 1 minute 40 seconds\n")
6153

6254

6355
def test_ensure_file_dne():

0 commit comments

Comments
 (0)