Commit Graph

40 Commits

Author SHA1 Message Date
BethanyG
7ea631f440 [Transpose & generate_tests.py]: Added join env Function & Changed Template (#3760)
[no important files changed]
* Added join input function and changed template and test file for transpose exercise.
* Regenerated file to replace lines with text.
2024-08-26 14:34:27 -07:00
BethanyG
185fbdfac9 Random grammar, spelling and content edits. (#3581)
[no important files changed]
2023-12-27 06:02:10 -08:00
BethanyG
be794198e1 [Resistor Color Expert]: Corrected Small Typos (#3469)
* Corrected small typos around resistor bands.

* Due to failing CI, alterations to the test generator script were needed.
The generated vs submitted diff now skips the first three lines of the file
so that the generation date is not picked up and flagged as needing regeneration.

Sadly, a workaround was also needed to prevent Python difflib from noting the difference
anyways and producing an empty "false positive" diff.

All templates and test files also needed to be altered to ensure that the first three
lines of every test file will always be the autogeneration comment and date.

Hopefully, this will now stop the CI failures without creating any subtle additional bugs.

* Touch up to bowling template.  Added back the error raising utility.
* Touch up to two-bucket template to add back in error raising utility.
[no important files changed]
2023-07-21 16:54:40 -07:00
BethanyG
aa3e379ff1 [DOCS]: Update Python Versions and Requirements (#3467)
* Additional sweep to update Python versions and supported Python versions.
* Fixed requirements and CONTRIBUTING.
* Trying a different line skip to see if it fixes CI.  CI is failing on test file generation again.
* Once again re-rendering tests to see if it fixes CI.
[no important files changed]
2023-07-16 15:09:14 -07:00
BethanyG
b49664ac66 [Tooling]: Changed Generate Script to Skip Diffing Generated Comments & Timestamp (#3466)
* Changed generate script to skp diffing generated comments and timestamp at top of file.
* Reordered and regenerated test files for practice exercises.
[no important files changed]
2023-07-15 15:27:31 -07:00
BethanyG
e7a6b0dc7d [JinJa2] Corrected the macro used for comments on the test file. (#3373)
* Corrected the macro for comments on the test file.
* Added current_date (utcnow()) variable available for template macros.
* Removed unnecessary datetime import from macros file.
* Regenerated all practice exercise test files to add timestamp.
* Changed `datetime.now(tz=timezone.utc)` to `datetime.now(tz=timezone.utc).date()`
* Second regeneration to remove `timestamp` and just keep `date` for test files.
[no important files changed]
2023-07-14 15:52:15 -07:00
BethanyG
6cc4b919ec [Track CI] Upgrade Workflow to use Python 3.11.2 & Pytest 7.2.2 (#3382)
* Upgraded CI workflow to use Python 3.11.2 and Pytest 7.2.2

* Pinned Pylint version to ~=2.17.1

* Added tomli to test_exercises.py imports.

* Adding in tomli for dependancies.

* Need to use latest build of Black due to Python 3.11 and packaging problems with tomli

* Regenerated test files for exercises failing CI.

* Try removing tomli to see if it fixes CI for Py3.11

* And more version fishing for black, which is the culprit here.

* Regeneraed test files with black 22.3.0, since black 23.3.0 is incompatible with Python 3.11 due to tomli conflicts.

* Trying a different strategy.  Using only 3.11 for the main container.

* Must import tomllib, part of exteded standard lib not core.

* Wrapped tomllib in a try-catch and aliased importing tomli.  Updated requirements to only install tmli on 3.10 and below.

* Forgot to update the imports in the generator.

* Added paasio test changes here, since this changes the CI checker to use Python 3.11.

* Trying a msg= approach.
2023-04-07 13:20:05 +02:00
BethanyG
3b8098b0f8 Added jinja2 systemfileloader workaround for windows paths. 2022-06-08 14:45:06 -07:00
BethanyG
6a787c40e0 Updated generate.py to use tomli for black compatability. 2022-03-30 15:44:08 -07:00
Corey McCandless
697d429bae update tooling for tests.toml changes 2021-03-02 09:34:43 -08:00
Corey McCandless
66edade424 various tooling improvements 2021-02-03 11:41:30 -05:00
Corey McCandless
058a94b4b9 test generator: get tested properties after filtering cases 2021-02-03 06:45:22 -08:00
Corey McCandless
84c111ecd7 do not fail generator if tests.toml not found 2021-02-01 19:08:02 -08:00
Corey McCandless
8f0964bbed update generate_tests.py for v3 2021-02-01 19:08:02 -08:00
Corey McCandless
6427d3b017 Handle missing tests.toml 2020-10-16 23:16:15 -04:00
Corey McCandless
ccd34bf89d Use tests.toml to to filter test cases from spec 2020-10-16 23:16:15 -04:00
Srdjan Stankovic
b4bc89aebc diffie-hellman: add test template (#2203)
Co-authored-by: Corey McCandless <cmccandless@users.noreply.github.com>
2020-05-28 11:18:13 -04:00
Michael Morehouse
1192f536fb [sgf-parsing] fix escaped characters (#2181)
Fixes issue with pytest throwing a warning on invalid escapes.

Closes #2176
2020-02-25 10:48:19 -05:00
beatorizu
60cb5a477f grep: add test template (#2106)
* grep: add test template

* queen-attack: create macro to apply to canonical and additional test cases

* grep: extract variables

* grep: set variable name using filename

Remove hard-code files variables name and change filesnames dict to list to avoid duplicated work in case of add files to test.

* grep: read filename from canonical data comments

* grep: create content variables

Set builtin zip as jinja filter to iterate names and contents lists.

* grep: add mock-file

* create plugins file and move appropriate content there
2019-12-19 13:44:53 -05:00
Michael Morehouse
ad801810c8 Gigasecond template (#2135)
* Add gigasecond test template and generate tests.

* Add datetime import.

* gigasecond: add test template

Adds the gigasecond test template. Addresses most of the concerns on the
defunct #2066 submitted by @simonbcodes, however the `strptime` fix
suggested by @cmccandless was brittle, as some of the incoming data had
time data.

We'd _maybe_ want to add a `dateutil` dependency if the canonical data
strays in any way from bog standard ISO 8601 dates, but hopefully if
that happens the `datetime.fromisoformat` calls here will blow up and
let us know.

Closes #1950

* gigasecond: generate with dateutil parse

Adds a dependency to the generator, but shifts the work off the student.
As an added benefit should parse a lot more than fromisoformat would.

Must be merged _after_ #2134.

* Update requirements-generator.txt

Woops!

Co-Authored-By: Corey McCandless <cmccandless@users.noreply.github.com>
2019-11-20 14:57:18 -05:00
Michael Morehouse
d3d04fb72f generate_tests: allow newer Python versions (#2134)
* generate_tests: allow newer Python versions

Current version forces 3.7, but one of the few pains of being on Arch
Linux is that _suddenly_ you're on 3.8.

* generate_tests: relax to 3.6
2019-11-20 13:27:30 -05:00
Michael Morehouse
53cef5b03f generate_tests: option to wrap long lines (#2125)
Adds a function to the render environment to allow line wrapping of VERY
long strings. Updates the alphametics test as an example.
2019-11-13 10:00:17 -05:00
Corey McCandless
99f3d35b1e generator: sort exercises before executing (#2112) 2019-11-06 14:38:57 -05:00
Corey McCandless
503ebd5e71 generator: detailed output for --check (#2110) 2019-11-06 13:39:53 -05:00
Corey McCandless
fe29831e8f generator: Add support for exercise plugins (#2097)
* generator: Add support for exercise plugins

* use importlib for importing plugins

* handle plugin SyntaxError

* group SyntaxError with TypeError, UndefinedError
2019-10-29 16:44:59 -04:00
Lucas Scarlato Astur
f9cc6e944c Removed unused import (#2100)
removed unused import from generate_tests code
2019-10-29 10:23:21 -04:00
Corey McCandless
571dcd2257 add regex_replace filter to generator (#2082) 2019-10-22 10:50:01 -04:00
Michael Morehouse
e7ba84007c generator: handle no local black install (#2061)
Fix incorrect error message when black is not installed.

Resolves #2060
2019-10-15 13:47:37 -04:00
Collin Smith
4be50bb825 Update template path formatting (#2027)
Allows for template creation in a Windows environment.
2019-10-03 17:23:25 -04:00
Corey McCandless
dd698d18ef Add track Contributing Guide and Generator documentation (#1900)
* Add Track Contributing Guide

* Add test generator documentation

* fix heading format

* fix table HTML

* incorporate review suggestions

Suggestions: https://github.com/exercism/python/pull/1900#pullrequestreview-272542702

Co-authored-by: Michael Morehouse <640167+yawpitch@users.noreply.github.com>
2019-08-08 17:49:02 +01:00
Corey McCandless
23f671e3a3 Use import with context for generators (#1896) 2019-08-07 09:45:02 -04:00
Corey McCandless
866a1ef9f3 word-count: add test template (#1888) 2019-08-06 14:45:35 -04:00
Corey McCandless
18c90d81da Add support for additional tests to generator script (#1886) 2019-08-06 14:41:00 -04:00
Corey McCandless
ac581690af twelve-days: add test template (#1883)
- add header, footer generator macros
2019-08-06 13:35:53 +01:00
Corey McCandless
3050a360cc hamming: add test template
- add 'is error_case' Jinja2 test
- create Jinja2 macros file, add utility method macro
2019-07-29 23:42:12 -05:00
Corey McCandless
a725ccb0fd high-scores: add test template (#1866)
* high-scores: add test template

* add missing exception assignment

* skip `scores` tests
2019-07-24 21:05:08 +01:00
Corey McCandless
d207e1ce66 hello-world: add test template (#1863)
* hello-world: add test template

* generate_tests.py: use NamedTemporaryFile instead of mkstemp
2019-07-24 12:35:16 -04:00
Corey McCandless
36166de0fa generator: fix fd operation calls (#1865) 2019-07-24 11:34:00 -04:00
Corey McCandless
61f4f2bef3 generator: run black on rendering before --check (#1864) 2019-07-24 10:54:59 -04:00
Corey McCandless
380ae91f33 Create test suite generator (requires per-exercise templates) (#1857)
* Add test generator script

* add .flake8 file to handle line length discrepency with black

* add requirements file for generator script

* Run bin/generate_tests.py in Travis HOUSEKEEPING job to ensure template changes have been applied

* add --check flag to generator script and refactor CI calls

Co-authored-by: Michael Morehouse <640167+yawpitch@users.noreply.github.com>
2019-07-24 09:49:01 -04:00