All Algorithms implemented in Python the-algorithms.com/
Go to file
Dhruv ceacfc6079
Add algorithm for testing Project Euler solutions (#2471)
* Add file for testing Project Euler solutions

* Remove the importlib import

* Update project_euler/solution_test.py

Co-authored-by: Christian Clauss <cclauss@me.com>

* Small tweaks to project_euler/solution_test.py

* Test Project Euler solutions through Travis

* Improved testing for Project Euler solutions:

- Renamed file so that it isn't picked up by pytest
- Fail fast on validating solutions through Travis CI

* Update validate_solutions.py

* Use namedtuple for input parameters and answer

- Remove logging
- Remove unnecessary checks for PROJECT_EULER_PATH as Travis CI
  picks up the same path

* Fix flake8 errors: line too long

* Small tweaks to validate_solutions.py

* Add all answers & back to using dictionary

* Using pytest for testing Project Euler solutions

- As we want to fail fast on testing solutions, we need to test using
  this script first before we use tests written by the author.
- As pytest stops testing as soon as it receives a traceback, we need to
  use pytest-subtests to tell pytest to test all the iterations for the
  function with given parameters.

* Print error messages in oneline format

* Separated answers into a separate file:

- Add custom print function to print all the error messages at the
  end of all the tests
- Let Travis skip if this failed

Co-authored-by: Christian Clauss <cclauss@me.com>
2020-09-28 08:18:19 +02:00
.github Use self-documenting option instead of cryptic option (#2487) 2020-09-26 16:54:41 +02:00
arithmetic_analysis Small fix (#2498) 2020-09-27 15:05:09 +02:00
backtracking Fixed linked list bug (#2481) 2020-09-25 18:08:57 +02:00
bit_manipulation Fixed reverse words algorithm (#2469) 2020-09-24 19:12:52 +08:00
blockchain Optimized recursive_bubble_sort (#2410) 2020-09-10 10:31:26 +02:00
boolean_algebra Docstrings and formatting improvements (#2418) 2020-09-14 14:40:27 +02:00
cellular_automata from __future__ import annotations (#2464) 2020-09-23 13:30:13 +02:00
ciphers Update morse_code_implementation.py (#2386) 2020-09-25 19:03:15 +02:00
compression from __future__ import annotations (#2464) 2020-09-23 13:30:13 +02:00
computer_vision isort --profile black . (#2181) 2020-07-06 09:44:19 +02:00
conversions Update and rename bin_to_octal.py to binary_to_octal.py (#2449) 2020-09-19 14:58:08 +08:00
data_structures Updated circular_linked_list (#2483) 2020-09-26 22:57:09 +08:00
digital_image_processing Optimized recursive_bubble_sort (#2410) 2020-09-10 10:31:26 +02:00
divide_and_conquer from __future__ import annotations (#2464) 2020-09-23 13:30:13 +02:00
dynamic_programming from __future__ import annotations (#2464) 2020-09-23 13:30:13 +02:00
file_transfer Renamed files and fixed Doctest (#2421) 2020-09-13 13:27:20 +02:00
fuzzy_logic isort --profile black . (#2181) 2020-07-06 09:44:19 +02:00
genetic_algorithm from __future__ import annotations (#2464) 2020-09-23 13:30:13 +02:00
geodesy isort --profile black . (#2181) 2020-07-06 09:44:19 +02:00
graphics from __future__ import annotations (#2464) 2020-09-23 13:30:13 +02:00
graphs from __future__ import annotations (#2464) 2020-09-23 13:30:13 +02:00
greedy_method isort --profile black . (#2181) 2020-07-06 09:44:19 +02:00
hashes Optimized recursive_bubble_sort (#2410) 2020-09-10 10:31:26 +02:00
images Add Travis_CI_tests_are_failing.md (#1499) 2019-10-28 13:38:08 +01:00
linear_algebra from __future__ import annotations (#2464) 2020-09-23 13:30:13 +02:00
machine_learning Gradient Boosting Regressor (#2298) 2020-09-26 16:58:29 +02:00
maths from __future__ import annotations (#2464) 2020-09-23 13:30:13 +02:00
matrix from __future__ import annotations (#2464) 2020-09-23 13:30:13 +02:00
networking_flow Tighten up psf/black and flake8 (#2024) 2020-05-22 08:10:11 +02:00
neural_network isort --profile black . (#2181) 2020-07-06 09:44:19 +02:00
other Add Python type hints and doctests to other/two_sum.py (#2467) 2020-09-23 21:55:51 +02:00
project_euler Add algorithm for testing Project Euler solutions (#2471) 2020-09-28 08:18:19 +02:00
quantum Update README.md (#1842) 2020-04-07 23:56:21 +02:00
scheduling from __future__ import annotations (#2464) 2020-09-23 13:30:13 +02:00
scripts Fix copy / paste oversight (#2448) 2020-09-19 07:25:18 +02:00
searches from __future__ import annotations (#2464) 2020-09-23 13:30:13 +02:00
sorts Wiggle sort (#2419) 2020-09-25 09:18:00 +02:00
strings Optimization for pangram string (#2473) 2020-09-26 22:58:59 +08:00
traversals from __future__ import annotations (#2464) 2020-09-23 13:30:13 +02:00
web_programming from __future__ import annotations (#2464) 2020-09-23 13:30:13 +02:00
.coveragerc Add pytest-cov (#1578) 2019-11-17 19:37:58 +01:00
.gitignore contribution guidelines checks (#1787) 2020-03-04 13:40:28 +01:00
.gitpod.yml Change gitpod configuration for python3. (#1827) 2020-04-07 12:20:08 +02:00
.travis.yml Add algorithm for testing Project Euler solutions (#2471) 2020-09-28 08:18:19 +02:00
CONTRIBUTING.md Update CONTRIBUTING.md (#2378) 2020-08-31 21:34:44 +02:00
DIRECTORY.md Use self-documenting option instead of cryptic option (#2487) 2020-09-26 16:54:41 +02:00
LICENSE.md Update year in LICENSE.md (#1848) 2020-04-13 02:17:29 +02:00
pytest.ini Add pytest init file to define custom mark mat_ops (#2120) 2020-06-15 18:09:32 +02:00
README.md Fix psf/black issues than fail the build (#1935) 2020-05-03 23:58:44 +02:00
requirements.txt file-transfer: writing tests and ensuring that all is going well (#2413) 2020-09-11 23:13:43 +02:00
Travis_CI_tests_are_failing.md Add Travis_CI_tests_are_failing.md (#1499) 2019-10-28 13:38:08 +01:00

The Algorithms - Python

Gitpod Ready-to-Code Gitter chat  Build Status  LGTM  contributions welcome  Donate   

All algorithms implemented in Python (for education)

These implementations are for learning purposes. They may be less efficient than the implementations in the Python standard library.

Contribution Guidelines

Read our Contribution Guidelines before you contribute.

Community Channel

We're on Gitter! Please join us.

List of Algorithms

See our directory.