Python/project_euler
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
..
problem_01 added solution 7 for problem_01 (#1416) 2019-10-22 09:31:17 +02:00
problem_02 Tighten up psf/black and flake8 (#2024) 2020-05-22 08:10:11 +02:00
problem_03 Tighten up psf/black and flake8 (#2024) 2020-05-22 08:10:11 +02:00
problem_04 Updated problem_04 in project_euler (#2427) 2020-09-14 22:33:08 +02:00
problem_05 Tighten up psf/black and flake8 (#2024) 2020-05-22 08:10:11 +02:00
problem_06 Updated problem_06 in Project Euler (#2439) 2020-09-17 11:37:53 +02:00
problem_07 isort --profile black . (#2181) 2020-07-06 09:44:19 +02:00
problem_08 Tighten up psf/black and flake8 (#2024) 2020-05-22 08:10:11 +02:00
problem_09 Optimization problem_10 in project_euler (#2453) 2020-09-22 15:15:11 +02:00
problem_10 Optimized recursive_bubble_sort (#2410) 2020-09-10 10:31:26 +02:00
problem_11 Tighten up psf/black and flake8 (#2024) 2020-05-22 08:10:11 +02:00
problem_12 psf/black code formatting (#1277) 2019-10-05 10:14:13 +05:00
problem_13 Travis CI: Add a flake8 test for unused imports (#1038) 2019-07-25 13:19:00 +05:30
problem_14 pyupgrade --py37-plus **/*.py (#1654) 2020-01-03 22:25:36 +08:00
problem_15 Optimized recursive_bubble_sort (#2410) 2020-09-10 10:31:26 +02:00
problem_16 Tighten up psf/black and flake8 (#2024) 2020-05-22 08:10:11 +02:00
problem_17 Added doctest and more explanation about Dijkstra execution. (#1014) 2019-07-17 01:09:53 +02:00
problem_18 psf/black code formatting (#1277) 2019-10-05 10:14:13 +05:00
problem_19 Fixes for issue "Fix the LGTM issues #1024" (#1034) 2019-07-18 19:05:14 +02:00
problem_20 GitHub Action formats our code with psf/black (#1569) 2019-11-14 19:59:43 +01:00
problem_21 pyupgrade --py37-plus **/*.py (#1654) 2020-01-03 22:25:36 +08:00
problem_22 pyupgrade --py37-plus **/*.py (#1654) 2020-01-03 22:25:36 +08:00
problem_23 psf/black code formatting (#1277) 2019-10-05 10:14:13 +05:00
problem_24 Added doctest and more explanation about Dijkstra execution. (#1014) 2019-07-17 01:09:53 +02:00
problem_25 pyupgrade --py37-plus **/*.py (#1654) 2020-01-03 22:25:36 +08:00
problem_26 Deal with maps (#1945) 2020-05-06 03:32:40 +02:00
problem_27 Optimized recursive_bubble_sort (#2410) 2020-09-10 10:31:26 +02:00
problem_28 Simplify code by dropping support for legacy Python (#1143) 2019-08-19 15:37:49 +02:00
problem_29 psf/black code formatting (#1277) 2019-10-05 10:14:13 +05:00
problem_30 Set the Python file maximum line length to 88 characters (#2122) 2020-06-16 10:09:19 +02:00
problem_31 Tighten up psf/black and flake8 (#2024) 2020-05-22 08:10:11 +02:00
problem_32 pyupgrade --py37-plus **/*.py (#1654) 2020-01-03 22:25:36 +08:00
problem_33 pyupgrade --py37-plus **/*.py (#1654) 2020-01-03 22:25:36 +08:00
problem_34 Created problem_45 in project_euler and Speed Boost for problem_34/sol1.py (#2349) 2020-08-25 13:48:19 +02:00
problem_35 from __future__ import annotations (#2464) 2020-09-23 13:30:13 +02:00
problem_36 psf/black code formatting (#1277) 2019-10-05 10:14:13 +05:00
problem_37 from __future__ import annotations (#2464) 2020-09-23 13:30:13 +02:00
problem_39 from __future__ import annotations (#2464) 2020-09-23 13:30:13 +02:00
problem_40 pyupgrade --py37-plus **/*.py (#1654) 2020-01-03 22:25:36 +08:00
problem_41 from __future__ import annotations (#2464) 2020-09-23 13:30:13 +02:00
problem_42 isort --profile black . (#2181) 2020-07-06 09:44:19 +02:00
problem_43 Created problem_43 in project_euler (#2340) 2020-08-20 17:02:14 +02:00
problem_44 Created problem_44 in project_euler (#2348) 2020-08-25 09:46:13 +02:00
problem_45 Created problem_45 in project_euler and Speed Boost for problem_34/sol1.py (#2349) 2020-08-25 13:48:19 +02:00
problem_46 from __future__ import annotations (#2464) 2020-09-23 13:30:13 +02:00
problem_47 Only one carriage return (#2155) 2020-06-25 19:15:30 +02:00
problem_48 Update sol1.py (#2455) 2020-09-20 21:33:26 +02:00
problem_52 Added doctest and more explanation about Dijkstra execution. (#1014) 2019-07-17 01:09:53 +02:00
problem_53 pyupgrade --py37-plus **/*.py (#1654) 2020-01-03 22:25:36 +08:00
problem_54 Add solution() for problem 54 of Project Euler (#2472) 2020-09-24 15:16:55 +02:00
problem_55 Created problem_55 in project_euler (#2354) 2020-08-26 13:31:13 +02:00
problem_56 Optimized recursive_bubble_sort (#2410) 2020-09-10 10:31:26 +02:00
problem_63 Created problem_63 in project_euler (#2357) 2020-08-27 13:40:03 +02:00
problem_67 psf/black code formatting (#1277) 2019-10-05 10:14:13 +05:00
problem_76 Simplify code by dropping support for legacy Python (#1143) 2019-08-19 15:37:49 +02:00
problem_97 Created problem_97 in project euler (#2476) 2020-09-25 11:52:19 +02:00
problem_99 Wrap lines that go beyond GitHub Editor (#1925) 2020-05-01 23:36:35 +02:00
problem_234 Tighten up psf/black and flake8 (#2024) 2020-05-22 08:10:11 +02:00
problem_551 Euler problem 551 sol 1: Reduce McCabe code complexity (#2141) 2020-06-22 14:16:12 +02:00
project_euler_answers.json Add algorithm for testing Project Euler solutions (#2471) 2020-09-28 08:18:19 +02:00
README.md fixed project eular readme (#1391) 2019-10-18 23:52:32 +02:00
validate_solutions.py Add algorithm for testing Project Euler solutions (#2471) 2020-09-28 08:18:19 +02:00

ProjectEuler

Problems are taken from https://projecteuler.net/.

Project Euler is a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve. Project Euler is ideal for mathematicians who are learning to code.

Here the efficiency of your code is also checked. I've tried to provide all the best possible solutions.

For description of the problem statements, kindly visit https://projecteuler.net/show=all