mandelbrot.py: Commenting out long running tests (#5558) · csvila/TheAlgorithms-Python@bd9464e · GitHub
Skip to content

Commit bd9464e

Browse files
cclaussgithub-actions
andauthored
mandelbrot.py: Commenting out long running tests (TheAlgorithms#5558)
* mandelbrot.py: Commenting out long running tests * updating DIRECTORY.md * Comment out 9 sec doctests * Update bidirectional_breadth_first_search.py * Comment out slow tests * Comment out slow (9.15 sec) pytests... * # Comment out slow (4.20s call) doctests * Comment out slow (3.45s) doctests * Update miller_rabin.py * Update miller_rabin.py Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
1 parent 218d892 commit bd9464e

5 files changed

Lines changed: 21 additions & 11 deletions

File tree

DIRECTORY.md

Lines changed: 3 additions & 0 deletions

fractals/mandelbrot.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,11 @@ def get_image(
101101
of the Mandelbrot set is viewed. The main area of the Mandelbrot set is
102102
roughly between "-1.5 < x < 0.5" and "-1 < y < 1" in the figure-coordinates.
103103
104-
>>> get_image().load()[0,0]
104+
Commenting out tests that slow down pytest...
105+
# 13.35s call fractals/mandelbrot.py::mandelbrot.get_image
106+
# >>> get_image().load()[0,0]
105107
(255, 0, 0)
106-
>>> get_image(use_distance_color_coding = False).load()[0,0]
108+
# >>> get_image(use_distance_color_coding = False).load()[0,0]
107109
(255, 255, 255)
108110
"""
109111
img = Image.new("RGB", (image_width, image_height))

graphs/bidirectional_breadth_first_search.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,19 @@ def __init__(
3434

3535
class BreadthFirstSearch:
3636
"""
37-
>>> bfs = BreadthFirstSearch((0, 0), (len(grid) - 1, len(grid[0]) - 1))
38-
>>> (bfs.start.pos_y + delta[3][0], bfs.start.pos_x + delta[3][1])
37+
# Comment out slow pytests...
38+
# 9.15s call graphs/bidirectional_breadth_first_search.py:: \
39+
# graphs.bidirectional_breadth_first_search.BreadthFirstSearch
40+
# >>> bfs = BreadthFirstSearch((0, 0), (len(grid) - 1, len(grid[0]) - 1))
41+
# >>> (bfs.start.pos_y + delta[3][0], bfs.start.pos_x + delta[3][1])
3942
(0, 1)
40-
>>> [x.pos for x in bfs.get_successors(bfs.start)]
43+
# >>> [x.pos for x in bfs.get_successors(bfs.start)]
4144
[(1, 0), (0, 1)]
42-
>>> (bfs.start.pos_y + delta[2][0], bfs.start.pos_x + delta[2][1])
45+
# >>> (bfs.start.pos_y + delta[2][0], bfs.start.pos_x + delta[2][1])
4346
(1, 0)
44-
>>> bfs.retrace_path(bfs.start)
47+
# >>> bfs.retrace_path(bfs.start)
4548
[(0, 0)]
46-
>>> bfs.search() # doctest: +NORMALIZE_WHITESPACE
49+
# >>> bfs.search() # doctest: +NORMALIZE_WHITESPACE
4750
[(0, 0), (1, 0), (2, 0), (3, 0), (3, 1), (4, 1),
4851
(5, 1), (5, 2), (5, 3), (5, 4), (5, 5), (6, 5), (6, 6)]
4952
"""

maths/miller_rabin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
def is_prime(n, prec=1000):
1010
"""
1111
>>> from .prime_check import prime_check
12-
>>> all(is_prime(i) == prime_check(i) for i in range(1000))
12+
>>> # all(is_prime(i) == prime_check(i) for i in range(1000)) # 3.45s
13+
>>> all(is_prime(i) == prime_check(i) for i in range(256))
1314
True
1415
"""
1516
if n < 2:

web_programming/download_images_from_google_query.py

Lines changed: 3 additions & 2 deletions

0 commit comments

Comments
 (0)