Skip to content

Commit

Permalink
mandelbrot.py: Commenting out long running tests (TheAlgorithms#5558)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
cclauss and github-actions authored Oct 23, 2021
1 parent 218d892 commit bd9464e
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 11 deletions.
3 changes: 3 additions & 0 deletions DIRECTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@
* [Breadth First Search Shortest Path](https://github.com/TheAlgorithms/Python/blob/master/graphs/breadth_first_search_shortest_path.py)
* [Check Bipartite Graph Bfs](https://github.com/TheAlgorithms/Python/blob/master/graphs/check_bipartite_graph_bfs.py)
* [Check Bipartite Graph Dfs](https://github.com/TheAlgorithms/Python/blob/master/graphs/check_bipartite_graph_dfs.py)
* [Check Cycle](https://github.com/TheAlgorithms/Python/blob/master/graphs/check_cycle.py)
* [Connected Components](https://github.com/TheAlgorithms/Python/blob/master/graphs/connected_components.py)
* [Depth First Search](https://github.com/TheAlgorithms/Python/blob/master/graphs/depth_first_search.py)
* [Depth First Search 2](https://github.com/TheAlgorithms/Python/blob/master/graphs/depth_first_search_2.py)
Expand Down Expand Up @@ -370,6 +371,7 @@
* [Md5](https://github.com/TheAlgorithms/Python/blob/master/hashes/md5.py)
* [Sdbm](https://github.com/TheAlgorithms/Python/blob/master/hashes/sdbm.py)
* [Sha1](https://github.com/TheAlgorithms/Python/blob/master/hashes/sha1.py)
* [Sha256](https://github.com/TheAlgorithms/Python/blob/master/hashes/sha256.py)

## Knapsack
* [Greedy Knapsack](https://github.com/TheAlgorithms/Python/blob/master/knapsack/greedy_knapsack.py)
Expand Down Expand Up @@ -979,6 +981,7 @@
* [Instagram Crawler](https://github.com/TheAlgorithms/Python/blob/master/web_programming/instagram_crawler.py)
* [Instagram Pic](https://github.com/TheAlgorithms/Python/blob/master/web_programming/instagram_pic.py)
* [Instagram Video](https://github.com/TheAlgorithms/Python/blob/master/web_programming/instagram_video.py)
* [Nasa Data](https://github.com/TheAlgorithms/Python/blob/master/web_programming/nasa_data.py)
* [Random Anime Character](https://github.com/TheAlgorithms/Python/blob/master/web_programming/random_anime_character.py)
* [Recaptcha Verification](https://github.com/TheAlgorithms/Python/blob/master/web_programming/recaptcha_verification.py)
* [Slack Message](https://github.com/TheAlgorithms/Python/blob/master/web_programming/slack_message.py)
Expand Down
6 changes: 4 additions & 2 deletions fractals/mandelbrot.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,11 @@ def get_image(
of the Mandelbrot set is viewed. The main area of the Mandelbrot set is
roughly between "-1.5 < x < 0.5" and "-1 < y < 1" in the figure-coordinates.
>>> get_image().load()[0,0]
Commenting out tests that slow down pytest...
# 13.35s call fractals/mandelbrot.py::mandelbrot.get_image
# >>> get_image().load()[0,0]
(255, 0, 0)
>>> get_image(use_distance_color_coding = False).load()[0,0]
# >>> get_image(use_distance_color_coding = False).load()[0,0]
(255, 255, 255)
"""
img = Image.new("RGB", (image_width, image_height))
Expand Down
15 changes: 9 additions & 6 deletions graphs/bidirectional_breadth_first_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,19 @@ def __init__(

class BreadthFirstSearch:
"""
>>> bfs = BreadthFirstSearch((0, 0), (len(grid) - 1, len(grid[0]) - 1))
>>> (bfs.start.pos_y + delta[3][0], bfs.start.pos_x + delta[3][1])
# Comment out slow pytests...
# 9.15s call graphs/bidirectional_breadth_first_search.py:: \
# graphs.bidirectional_breadth_first_search.BreadthFirstSearch
# >>> bfs = BreadthFirstSearch((0, 0), (len(grid) - 1, len(grid[0]) - 1))
# >>> (bfs.start.pos_y + delta[3][0], bfs.start.pos_x + delta[3][1])
(0, 1)
>>> [x.pos for x in bfs.get_successors(bfs.start)]
# >>> [x.pos for x in bfs.get_successors(bfs.start)]
[(1, 0), (0, 1)]
>>> (bfs.start.pos_y + delta[2][0], bfs.start.pos_x + delta[2][1])
# >>> (bfs.start.pos_y + delta[2][0], bfs.start.pos_x + delta[2][1])
(1, 0)
>>> bfs.retrace_path(bfs.start)
# >>> bfs.retrace_path(bfs.start)
[(0, 0)]
>>> bfs.search() # doctest: +NORMALIZE_WHITESPACE
# >>> bfs.search() # doctest: +NORMALIZE_WHITESPACE
[(0, 0), (1, 0), (2, 0), (3, 0), (3, 1), (4, 1),
(5, 1), (5, 2), (5, 3), (5, 4), (5, 5), (6, 5), (6, 6)]
"""
Expand Down
3 changes: 2 additions & 1 deletion maths/miller_rabin.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
def is_prime(n, prec=1000):
"""
>>> from .prime_check import prime_check
>>> all(is_prime(i) == prime_check(i) for i in range(1000))
>>> # all(is_prime(i) == prime_check(i) for i in range(1000)) # 3.45s
>>> all(is_prime(i) == prime_check(i) for i in range(256))
True
"""
if n < 2:
Expand Down
5 changes: 3 additions & 2 deletions web_programming/download_images_from_google_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ def download_images_from_google_query(query: str = "dhaka", max_images: int = 5)
Returns:
The number of images successfully downloaded.
>>> download_images_from_google_query()
# Comment out slow (4.20s call) doctests
# >>> download_images_from_google_query()
5
>>> download_images_from_google_query("potato")
# >>> download_images_from_google_query("potato")
5
"""
max_images = min(max_images, 50) # Prevent abuse!
Expand Down

0 comments on commit bd9464e

Please sign in to comment.