Commit Graph

30 Commits

Author SHA1 Message Date
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