Skip to content

Commit 00a64cf

Browse files
authored
Revert "Commented doctests that were causing slowness at Travis. (#1039)"
This reverts commit f7ac8b5.
1 parent f7ac8b5 commit 00a64cf

File tree

9 files changed

+41
-36
lines changed

9 files changed

+41
-36
lines changed

Diff for: .travis.yml

+25-13
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,31 @@ before_script:
99
- flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
1010
script:
1111
- mypy --ignore-missing-imports .
12-
- pytest . --doctest-modules
13-
--ignore=data_structures/stacks/balanced_parentheses.py
14-
--ignore=data_structures/stacks/infix_to_postfix_conversion.py
15-
--ignore=file_transfer_protocol/ftp_send_receive.py
16-
--ignore=file_transfer_protocol/ftp_client_server.py
17-
--ignore=machine_learning/linear_regression.py
18-
--ignore=machine_learning/perceptron.py
19-
--ignore=machine_learning/random_forest_classification/random_forest_classification.py
20-
--ignore=machine_learning/random_forest_regression/random_forest_regression.py
21-
--ignore=maths/abs_min.py
22-
--ignore=maths/binary_exponentiation.py
23-
--ignore=maths/lucas_series.py
24-
--ignore=maths/sieve_of_eratosthenes.py
12+
#- IGNORE="data_structures,file_transfer_protocol,graphs,machine_learning,maths,neural_network,project_euler"
13+
#- pytest . --doctest-modules --ignore=${IGNORE}
14+
- pytest --doctest-modules
15+
arithmetic_analysis
16+
backtracking
17+
boolean_algebra
18+
ciphers
19+
compression
20+
conversions
21+
digital_image_processing
22+
divide_and_conquer
23+
dynamic_programming
24+
graphs
25+
hashes
26+
linear_algebra_python
27+
matrix
28+
networking_flow
29+
neural_network
30+
other
31+
project_euler
32+
searches
33+
sorts
34+
strings
35+
traversals
36+
2537
after_success:
2638
- python scripts/build_directory_md.py
2739
- cat DIRECTORY.md

Diff for: project_euler/problem_09/sol1.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ def solution():
1818
2. a**2 + b**2 = c**2
1919
3. a + b + c = 1000
2020
21-
# The code below has been commented due to slow execution affecting Travis.
22-
# >>> solution()
23-
# 31875000
21+
>>> solution()
22+
31875000
2423
"""
2524
for a in range(300):
2625
for b in range(400):

Diff for: project_euler/problem_09/sol3.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ def solution():
2121
1. a**2 + b**2 = c**2
2222
2. a + b + c = 1000
2323
24-
#>>> solution()
25-
#31875000
24+
>>> solution()
25+
31875000
2626
"""
2727
return [
2828
a * b * c

Diff for: project_euler/problem_10/sol1.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,8 @@ def sum_of_primes(n):
4242
def solution(n):
4343
"""Returns the sum of all the primes below n.
4444
45-
# The code below has been commented due to slow execution affecting Travis.
46-
# >>> solution(2000000)
47-
# 142913828922
45+
>>> solution(2000000)
46+
142913828922
4847
>>> solution(1000)
4948
76127
5049
>>> solution(5000)

Diff for: project_euler/problem_10/sol2.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@ def prime_generator():
3131
def solution(n):
3232
"""Returns the sum of all the primes below n.
3333
34-
# The code below has been commented due to slow execution affecting Travis.
35-
# >>> solution(2000000)
36-
# 142913828922
34+
>>> solution(2000000)
35+
142913828922
3736
>>> solution(1000)
3837
76127
3938
>>> solution(5000)

Diff for: project_euler/problem_12/sol1.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,8 @@ def solution():
4545
"""Returns the value of the first triangle number to have over five hundred
4646
divisors.
4747
48-
# The code below has been commented due to slow execution affecting Travis.
49-
# >>> solution()
50-
# 76576500
48+
>>> solution()
49+
76576500
5150
"""
5251
tNum = 1
5352
i = 1

Diff for: project_euler/problem_12/sol2.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@ def solution():
3939
"""Returns the value of the first triangle number to have over five hundred
4040
divisors.
4141
42-
# The code below has been commented due to slow execution affecting Travis.
43-
# >>> solution()
44-
# 76576500
42+
>>> solution()
43+
76576500
4544
"""
4645
return next(
4746
i for i in triangle_number_generator() if count_divisors(i) > 500

Diff for: project_euler/problem_14/sol1.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@ def solution(n):
3030
n → n/2 (n is even)
3131
n → 3n + 1 (n is odd)
3232
33-
# The code below has been commented due to slow execution affecting Travis.
34-
# >>> solution(1000000)
35-
# {'counter': 525, 'largest_number': 837799}
33+
>>> solution(1000000)
34+
{'counter': 525, 'largest_number': 837799}
3635
>>> solution(200)
3736
{'counter': 125, 'largest_number': 171}
3837
>>> solution(5000)

Diff for: project_euler/problem_14/sol2.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ def collatz_sequence(n):
4747
def solution(n):
4848
"""Returns the number under n that generates the longest Collatz sequence.
4949
50-
# The code below has been commented due to slow execution affecting Travis.
51-
# >>> solution(1000000)
52-
# {'counter': 525, 'largest_number': 837799}
50+
>>> solution(1000000)
51+
{'counter': 525, 'largest_number': 837799}
5352
>>> solution(200)
5453
{'counter': 125, 'largest_number': 171}
5554
>>> solution(5000)

0 commit comments

Comments
 (0)