Skip to content

Commit bd9464e

Browse files
cclaussgithub-actions
and
github-actions
authored
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

File tree

5 files changed

+21
-11
lines changed

5 files changed

+21
-11
lines changed

DIRECTORY.md

+3
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@
317317
* [Breadth First Search Shortest Path](https://github.com/TheAlgorithms/Python/blob/master/graphs/breadth_first_search_shortest_path.py)
318318
* [Check Bipartite Graph Bfs](https://github.com/TheAlgorithms/Python/blob/master/graphs/check_bipartite_graph_bfs.py)
319319
* [Check Bipartite Graph Dfs](https://github.com/TheAlgorithms/Python/blob/master/graphs/check_bipartite_graph_dfs.py)
320+
* [Check Cycle](https://github.com/TheAlgorithms/Python/blob/master/graphs/check_cycle.py)
320321
* [Connected Components](https://github.com/TheAlgorithms/Python/blob/master/graphs/connected_components.py)
321322
* [Depth First Search](https://github.com/TheAlgorithms/Python/blob/master/graphs/depth_first_search.py)
322323
* [Depth First Search 2](https://github.com/TheAlgorithms/Python/blob/master/graphs/depth_first_search_2.py)
@@ -370,6 +371,7 @@
370371
* [Md5](https://github.com/TheAlgorithms/Python/blob/master/hashes/md5.py)
371372
* [Sdbm](https://github.com/TheAlgorithms/Python/blob/master/hashes/sdbm.py)
372373
* [Sha1](https://github.com/TheAlgorithms/Python/blob/master/hashes/sha1.py)
374+
* [Sha256](https://github.com/TheAlgorithms/Python/blob/master/hashes/sha256.py)
373375

374376
## Knapsack
375377
* [Greedy Knapsack](https://github.com/TheAlgorithms/Python/blob/master/knapsack/greedy_knapsack.py)
@@ -979,6 +981,7 @@
979981
* [Instagram Crawler](https://github.com/TheAlgorithms/Python/blob/master/web_programming/instagram_crawler.py)
980982
* [Instagram Pic](https://github.com/TheAlgorithms/Python/blob/master/web_programming/instagram_pic.py)
981983
* [Instagram Video](https://github.com/TheAlgorithms/Python/blob/master/web_programming/instagram_video.py)
984+
* [Nasa Data](https://github.com/TheAlgorithms/Python/blob/master/web_programming/nasa_data.py)
982985
* [Random Anime Character](https://github.com/TheAlgorithms/Python/blob/master/web_programming/random_anime_character.py)
983986
* [Recaptcha Verification](https://github.com/TheAlgorithms/Python/blob/master/web_programming/recaptcha_verification.py)
984987
* [Slack Message](https://github.com/TheAlgorithms/Python/blob/master/web_programming/slack_message.py)

fractals/mandelbrot.py

+4-2
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

+9-6
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

+2-1
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

+3-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ def download_images_from_google_query(query: str = "dhaka", max_images: int = 5)
2424
Returns:
2525
The number of images successfully downloaded.
2626
27-
>>> download_images_from_google_query()
27+
# Comment out slow (4.20s call) doctests
28+
# >>> download_images_from_google_query()
2829
5
29-
>>> download_images_from_google_query("potato")
30+
# >>> download_images_from_google_query("potato")
3031
5
3132
"""
3233
max_images = min(max_images, 50) # Prevent abuse!

0 commit comments

Comments
 (0)