Wykres commitów

973 Commity (main)

Autor SHA1 Wiadomość Data
Simon Willison fefb0db8ae
Unit test for 02870e57, closes #291 2018-05-28 13:41:53 -07:00
Simon Willison a4d6acc239
Use scope='session' for all fixtures
This means they will only be executed once which makes sense
since the database they create is immutable.
2018-05-28 13:41:06 -07:00
Simon Willison 76d11eb768
New ?_json=colname argument for returning unescaped JSON
Also extracted docs for special JSON arguments into a new section.

Closes #31
2018-05-28 11:08:39 -07:00
Simon Willison 7944a8b0de
Added num_sql_threads config option, closes #285 2018-05-26 17:43:22 -07:00
Simon Willison 276913b748
?_shape=arrayfirst, closes #287 2018-05-26 17:32:15 -07:00
Simon Willison b463f60158
?_ttl= parameter and default_cache_ttl config
Refs #285, Closes #289
2018-05-26 15:17:33 -07:00
Simon Willison a6afc21aba
Test that ensures all config options are documented 2018-05-26 15:11:16 -07:00
Simon Willison f722b0a730
allow_sql config option to disable custom SQL, closes #284 2018-05-24 22:50:50 -07:00
Simon Willison 50920cfe3d
allow_facet, allow_download, suggest_facets boolean --config
Refs #284
2018-05-24 18:12:27 -07:00
Simon Willison 2bfd111d65
Faceting no longer breaks pagination, fixes #282 2018-05-23 06:41:14 -07:00
Simon Willison f6183ff5fa
Renamed --limit to --config, added --help-config, closes #274
Removed the --page_size= argument to datasette serve in favour of:

    datasette serve --config default_page_size:50 mydb.db

Added new help section:

    $ datasette --help-config
    Config options:
      default_page_size            Default page size for the table view
                                   (default=100)
      max_returned_rows            Maximum rows that can be returned from a table
                                   or custom query (default=1000)
      sql_time_limit_ms            Time limit for a SQL query in milliseconds
                                   (default=1000)
      default_facet_size           Number of values to return for requested facets
                                   (default=30)
      facet_time_limit_ms          Time limit for calculating a requested facet
                                   (default=200)
      facet_suggest_time_limit_ms  Time limit for calculating a suggested facet
                                   (default=50)
2018-05-20 10:01:49 -07:00
Simon Willison 39426ff0e4
Added /-/limits and /-/limits.json, closes #270 2018-05-17 23:16:28 -07:00
Simon Willison cef9a9a870
--limit= mechanism plus new limits for facets
Replaced the --max_returned_rows and --sql_time_limit_ms options to
"datasette serve" with a new --limit option, which supports a larger
list of limits.

Example usage:

	datasette serve --limit max_returned_rows:1000 \
		--limit sql_time_limit_ms:2500 \
		--limit default_facet_size:50 \
		--limit facet_time_limit_ms:1000 \
		--limit facet_suggest_time_limit_ms:500

New docs: https://datasette.readthedocs.io/en/latest/limits.html

Closes #270
Closes #264
2018-05-17 22:08:26 -07:00
Simon Willison b263da78e3 Reliable sort order for facets in Python 3.5, fixing test - refs #255 2018-05-16 08:27:24 -07:00
Simon Willison 6d12580ed7 Foreign key facets are now expanded to labels, refs #255 2018-05-16 08:27:24 -07:00
Simon Willison f4943ca89b _facet selections persist through table form, refs #255 2018-05-16 08:27:24 -07:00
Simon Willison 1dc94f6eaa Facets can now be toggled off again, refs #255 2018-05-16 08:27:24 -07:00
Simon Willison 142a550a99 Facet results now have "truncated" field
To indicate if there was more than 20 distinct values. Refs #255
2018-05-16 08:27:24 -07:00
Simon Willison a82175276c _sort/_next links now use new path_with_replaced_args method 2018-05-16 08:27:24 -07:00
Simon Willison 8a4ed052a5 path_with_added_args now works with multiple existing args 2018-05-16 08:27:24 -07:00
Simon Willison f36c9d4b4c Facet toggling now works for integer columns, refs #255 2018-05-16 08:27:24 -07:00
Simon Willison de05cf21aa Facet "selected" key and toggle_url now toggles, refs #255 2018-05-16 08:27:24 -07:00
Simon Willison 2b79f2bdeb path_with_added_args now preserves order in Python 3.5 2018-05-14 00:04:23 -03:00
Simon Willison 4301a8f3ac
Case insensitive querystring comparison, fix Python 3.5 2018-05-12 19:49:37 -03:00
Simon Willison eaaa3ea149
Initial implementation of facets, plus tests and docs
Refs #255
2018-05-12 19:29:41 -03:00
Simon Willison 70ff615f1b
utils.path_with_added_args() improvements
* Now covered by unit tests
* Preserves original order
* Can handle multiple args of the same name, e.g. ?bar=1&bar=2
2018-05-12 18:44:09 -03:00
Simon Willison 04d21ccd08
/-/versions now includes SQLite fts_versions, closes #252 2018-05-11 10:19:25 -03:00
Simon Willison 801381b765
Default tests to using a longer timelimit
Every now and then a test will fail in Travis CI on Python 3.5 because it hit
the default 20ms SQL time limit.

Test fixtures now default to a 200ms time limit, and we only use the 20ms time
limit for the specific test that tests query interruption. This should make
our tests on Python 3.5 in Travis much more stable.
2018-05-05 19:44:32 -03:00
Simon Willison 1259b8ac0b
Support _search_COLUMN=text searches, closes #237 2018-05-05 19:33:08 -03:00
Simon Willison 4d6a568d6c
Unit tests for _search= feature, refs #237 2018-05-05 19:01:14 -03:00
Simon Willison ca290719ed
Show version on /-/plugins page, closes #248 2018-05-04 15:04:33 -03:00
Simon Willison d4da4c92c8
?_size=max option, closes #249 2018-05-04 15:03:40 -03:00
Simon Willison bb87cf8730
Added /-/versions and /-/versions.json, closes #244
Sample output:

    {
      "python": {
        "version": "3.6.3",
        "full": "3.6.3 (default, Oct  4 2017, 06:09:38) \n[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)]"
      },
      "datasette": {
        "version": "0.20"
      },
      "sqlite": {
        "version": "3.23.1",
        "extensions": {
          "json1": null,
          "spatialite": "4.3.0a"
        }
      }
    }
2018-05-03 11:09:27 -03:00
Simon Willison 690736436b Bump up time limit for test_paginate_tables_and_views
It was intermittently failing in Travis CI on Python 3.5:

https://travis-ci.org/simonw/datasette/jobs/373713476
2018-05-01 17:20:39 -07:00
Simon Willison 349e262bb1 Renamed ?_sql_time_limit_ms= to ?_timelimit, closes #242 2018-05-01 17:20:39 -07:00
Simon Willison a4cc5dc813 New ?_shape=array option + tweaks to _shape, closes #245
* Default is now ?_shape=arrays (renamed from lists)
* New ?_shape=array returns an array of objects as the root object
* Changed ?_shape=object to return the object as the root
* Updated docs
2018-05-01 17:20:39 -07:00
Simon Willison aa954382c3
FTS tables now detected by inspect(), closes #240 2018-04-28 17:04:32 -07:00
Simon Willison f188ceaa2a
New ?_size=XXX querystring parameter for table view, closes #229
Also added documentation for all of the _special arguments.

Plus deleted some duplicate logic implementing _group_count.
2018-04-25 21:47:12 -07:00
Simon Willison 4504d5160b
If max_returned_rows==page_size, increment max_returned_rows
Fixes #230, where if the two were equal pagination didn't work correctly.
2018-04-25 21:04:12 -07:00
Simon Willison 02ee31c8b4
New hidden: True option for table metadat, closes #239 2018-04-25 20:42:57 -07:00
Simon Willison 00ab954300
Added CSS class rows-and-columns to main table 2018-04-23 18:31:32 -07:00
Simon Willison f3f4295712
label_column now defined on the table-being-linked-to, fixes #234 2018-04-22 13:46:18 -07:00
Simon Willison f27cabbaf3
label_column option in metadata.json - closes #234 2018-04-22 10:53:16 -07:00
Simon Willison b52171db1e
Plugins can now bundle custom templates, closes #224
Refs #14
2018-04-18 22:50:27 -07:00
Simon Willison b55809a1e2
Added /-/metadata /-/plugins /-/inspect, closes #225 2018-04-18 22:25:22 -07:00
Simon Willison 404fa2252b
datasette publish/package --install option, closes #223
Allows you to specify one or more additional packages to be installed,
useful for deploying plugins.
2018-04-18 07:55:36 -07:00
Simon Willison 1c36d07dd4
New plugin hooks: extra_css_urls() and extra_js_urls()
Closes #214
2018-04-17 20:12:21 -07:00
Simon Willison a5792a8c61
<th> now gets class="col-X" - plus added col-X documentation
Refs #209
2018-04-17 19:11:54 -07:00
Simon Willison dfb87d012c
Use to_css_class for table cell column classes
This ensures that columns with spaces in the name will still
generate usable CSS class names. Refs #209
2018-04-17 18:19:21 -07:00
Russ Garrett 136a70d887 Add column name classes to <td>s, make PK bold 2018-04-17 18:13:02 -07:00
Russ Garrett 0f782dd8df Additional test asserts 2018-04-17 18:13:02 -07:00
Simon Willison aaf59db570
Longer time limit for test_paginate_compound_keys
It was failing intermittently in Travis - see #209
2018-04-17 18:09:48 -07:00
Simon Willison e7c769ef30
Working implementation of #216 which passes the tests
Reverted commit 5364fa7f33 (where I removed the
code that didn't work).

Added primary keys to order-by clause for sorting to get tests to pass
2018-04-16 18:41:55 -07:00
Simon Willison 5364fa7f33
Revert #216 until I can get tests to pass in Travis
Revert "Fix for _sort_desc=sortable_with_nulls test, refs #216"

This reverts commit 07fc2d113e.

Revert "Fixed #216 - paginate correctly when sorting by nullable column"

This reverts commit 2abe539a0f.
2018-04-16 17:53:37 -07:00
Simon Willison 07fc2d113e
Fix for _sort_desc=sortable_with_nulls test, refs #216 2018-04-16 17:05:03 -07:00
Simon Willison 2abe539a0f
Fixed #216 - paginate correctly when sorting by nullable column 2018-04-16 16:52:50 -07:00
Simon Willison b2955d9065
New --plugins-dir=plugins/ option (#212)
* New --plugins-dir=plugins/ option

New option causing Datasette to load and evaluate all of the Python files in
the specified directory and register any plugins that are defined in those
files.

This new option is available for the following commands:

    datasette serve mydb.db --plugins-dir=plugins/
    datasette publish now/heroku mydb.db --plugins-dir=plugins/
    datasette package mydb.db --plugins-dir=plugins/

* Unit tests for --plugins-dir=plugins/

Closes #211
2018-04-15 22:22:01 -07:00
Simon Willison dd4491dd81
Update number of expected tables 2018-04-14 08:16:54 -07:00
Simon Willison 6b15a53cd3
Unit test for unlabelled foreign keys from #207 2018-04-14 08:00:54 -07:00
Simon Willison d72201e883
Added unit test for foreign key links in HTML
Needed to add a further unit test for #207
2018-04-14 07:55:27 -07:00
Russ Garrett ed974417ad
Tests for unit filtering 2018-04-14 15:06:52 +01:00
Simon Willison 9f28bbe43d
Better mechanism for handling errors; 404s for missing table/database
New error mechanism closes #193

404s for missing tables/databesse closes #184

Makes pull request #202 unnecessary.
2018-04-13 11:17:22 -07:00
Simon Willison 46b237c29a
datasette inspect now finds primary_keys
Closes #195
2018-04-09 17:54:12 -07:00
Simon Willison 57b19f09d1
Ability to sort using form fields (for mobile portrait mode)
We now display sort options as a select box plus a descending checkbox, which
means you can apply sort orders even in portrait mode on a mobile phone where
the column headers are hidden.

Closes #199
2018-04-09 17:34:32 -07:00
Simon Willison a290f28caa
table_rows => table_rows_count, filtered_table_rows => filtered_table_rows_count
Renamed properties. Closes #194
2018-04-08 22:24:24 -07:00
Simon Willison c1d37fdf2b Fixed bug with human filter description, refs #189
We were showing this:

    201 rows where sorted by sortable_with_nulls

We now show this:

    201 rows sorted by sortable_with_nulls
2018-04-08 22:10:22 -07:00
Simon Willison b13f0986f2 New sortable_columns option in metadata.json to control sort options
You can now explicitly set which columns in a table can be used for sorting
using the _sort and _sort_desc arguments using metadata.json:

    {
        "databases": {
            "database1": {
                "tables": {
                    "example_table": {
                        "sortable_columns": [
                            "height",
                            "weight"
                        ]
                    }
                }
            }
        }
    }

Refs #189
2018-04-08 22:10:22 -07:00
Simon Willison a87df963a0 Error handling for ?_sort and ?_sort_desc
Verifies that they match an existing column, and only one or the other option
is provided - refs #189

Eses a new DatasetteError exception that closes #193
2018-04-08 22:10:22 -07:00
Simon Willison 747a801b50 Column headers now link to sort/desc sort - refs #189 2018-04-08 22:10:22 -07:00
Simon Willison 9f2ec39fbc Current sort order now reflected in human filter description
Plus renamed human_description to human_description_en

Refs #189
2018-04-08 22:10:22 -07:00
Simon Willison f3a3820ff5 _sort and _sort_desc parameters for table views
Allows for paginated sorted results based on a specified column.

Refs #189
2018-04-08 22:10:22 -07:00
Simon Willison 0abd3abacb
New ?_shape=objects/object/lists param for JSON API (#192)
New _shape= parameter replacing old .jsono extension

Now instead of this:

	/database/table.jsono

We use the _shape parameter like this:

	/database/table.json?_shape=objects

Also introduced a new _shape called 'object' which looks like this:

	/database/table.json?_shape=object

Returning an object for the rows key:

	...
	"rows": {
		"pk1": {
			...
		},
		"pk2": {
			...
		}
	}

Refs #122
2018-04-03 07:52:54 -07:00
Simon Willison dd0566ff8e
Utility for writing test database fixtures to a .db file
python tests/fixtures.py /tmp/hello.db

This is useful for making a SQLite database of the test fixtures for
interactive exploration.
2018-04-03 06:46:11 -07:00
Simon Willison 8f0d44d646
escape_sqlite_table_name => escape_sqlite, handles reserved words
It can be used for column names as well as table names.

Reserved word list from https://www.sqlite.org/lang_keywords.html
2018-04-03 06:40:49 -07:00
Simon Willison 7365c3f51c
Compound primary key _next= now plays well with extra filters
Closes #190
2018-03-29 23:26:22 -07:00
Simon Willison 31f63d1672
Fixed bug with keyset pagination over compound primary keys
Closes #190
2018-03-29 22:11:02 -07:00
Simon Willison 89d9fbb91b
Database/Table views inherit source/license/source_url/license_url metadata
If you set the source_url/license_url/source/license fields in your root
metadata those values will now be inherited all the way down to the database
and table templates.

The title/description are NOT inherited.

Also added unit tests for the HTML generated by the metadata.

Refs #185
2018-03-27 09:18:32 -07:00
Simon Willison 306e1c6ac4
Broke up test_app into test_api and test_html 2017-12-15 04:08:24 -08:00
Simon Willison ae94006809
No longer include database hash in hyperlinks
It was making the unit tests unreliable. Also we do not do that for foreign key links.
2017-12-09 17:31:08 -08:00
Simon Willison 794c3bfcfc
Cleaned up row/column display logic, fixed bug
Closes #167
2017-12-09 16:59:25 -08:00
Simon Willison 7a7e4b2ed8
Started unit tests for row/table HTML pages
Refs #167

Thanks to the new tests, spotted and fixed a bug where pages that were
supposed to have 100 things on them were actually displaying 101.
2017-12-09 15:32:54 -08:00
Simon Willison b01304d707
Updated tests I broke in c195ee4 2017-12-09 10:39:19 -08:00
Simon Willison cbfd6b745e
Publish should now work if /tmp is on different device
Fixes #141
2017-12-08 08:06:24 -08:00
Simon Willison 709f4f2798
Fixed bug with detecting FTS tables
Closes #135
2017-12-06 20:54:37 -08:00
Simon Willison 0cfd7ce59d
Allow WITH query (previously we required SELECT at start)
Fixes #161
2017-12-03 20:51:31 -08:00
Simon Willison 8ab3a169d4
CSS styling hooks as classes on the body
Refs #153

Every template now gets CSS classes in the body designed to support custom
styling.

The index template (the top level page at /) gets this:

    <body class="index">

The database template (/dbname/) gets this:

    <body class="db db-dbname">

The table template (/dbname/tablename) gets:

    <body class="table db-dbname table-tablename">

The row template (/dbname/tablename/rowid) gets:

    <body class="row db-dbname table-tablename">

The db-x and table-x classes use the database or table names themselves IF
they are valid CSS identifiers. If they aren't, we strip any invalid
characters out and append a 6 character md5 digest of the original name, in
order to ensure that multiple tables which resolve to the same stripped
character version still have different CSS classes.

Some examples (extracted from the unit tests):

    "simple" => "simple"
    "MixedCase" => "MixedCase"
    "-no-leading-hyphens" => "no-leading-hyphens-65bea6"
    "_no-leading-underscores" => "no-leading-underscores-b921bc"
    "no spaces" => "no-spaces-7088d7"
    "-" => "336d5e"
    "no $ characters" => "no--characters-59e024"
2017-11-29 23:09:54 -08:00
Simon Willison b67890d15d
Auto-link column values that look like URLs
Refs #153
2017-11-29 09:05:24 -08:00
Simon Willison c5c923d93c
Don't incorrectly detect VIEWs as supporting FTS 2017-11-24 14:51:00 -08:00
Simon Willison a802cbee74
Search now applies to current filters
Combined search into the same form as filters.

Closes #133
2017-11-24 14:29:54 -08:00
Simon Willison b450778391
Added column__not=blah filter
Closes #148
2017-11-23 14:09:50 -08:00
Simon Willison a30c5b220c
Fixed bug on rows page, added unit test
Rows page for rows that linked to the same table in more
than one columns were display incorrectly. Fixed that and added a test.

Also introduced /db/table/row-pk.json?_extras=foreign_key_tables

This is used by the new unit test, but is the first example of a new
?_extras=comma-separated-list pattern I am introducing.
2017-11-23 13:09:45 -08:00
Simon Willison ef3eacf622
Select option for removing filters 2017-11-23 12:32:54 -08:00
Simon Willison 0071b5d6f5
Added UI for editing table filters
Refs #86
2017-11-22 20:33:55 -08:00
Simon Willison 53534b6e9d
Even more complicated redirect scheme
This:

    ?_filter_column_1=name&_filter_op_1=contains&_filter_value_1=hello
    &_filter_column_2=age&_filter_op_2=gte&_filter_value_2=12

Now redirects to this:

    ?name__contains=hello&age__gte=12

This is needed for the filter editing interface, refs #86
2017-11-22 20:03:46 -08:00
Simon Willison c8e7c85fd3
Updated test_database_page test 2017-11-22 12:25:51 -08:00
Simon Willison a9b9d42791
Mark FTS-related tables as 'hidden' in inspect()
Refs #129
2017-11-21 12:55:59 -08:00
Simon Willison b4e6211a97
Refactored filter logic and added human descriptions - refs #86 2017-11-19 22:03:24 -08:00
Simon Willison a5881e105a
?_filter_column=col&_filter_op=isnull__1 redirect
if filter_op contains a __ the value is set to the right hand side.

e.g.

    ?_filter_column=col&_filter_op=isnull__1&_filter_value=x

Redirects to:

    ?col__isnull=1

Refs #86
2017-11-19 12:33:30 -08:00
Simon Willison 386fb11d42
?_filter_column=col&_filter_op=op&_filter_value=value redirect
Part of implementing the filters UI (refs #86) - the following:

    /trees/Trees?_filter_column=SiteOrder&_filter_op=gt&_filter_value=2

Now redirects to this;

    /trees/Trees?SiteOrder__gt=2
2017-11-19 12:25:29 -08:00
Simon Willison eed6a0fe36
Implemented ?_search=XXX + UI if a FTS table is detected
Closes #131
2017-11-19 08:59:26 -08:00
Simon Willison 45e502aace Added unit tests for inspect() foreign key detection
Used them to fix a bug with it.

Refs #85
2017-11-17 08:08:11 -08:00
Simon Willison 084350b0f1 Switched to gather_request=False for Sanic tests
Gets rid of those ugly _, response = lines.
2017-11-17 06:53:37 -08:00
Ray N ed2b3f25be add support for ?field__isnull=1 (#107)
* add support for ?field__isnull=1

* Add unit test and conditional formatting for ?field__isnull
2017-11-17 05:29:22 -08:00
Simon Willison 9cb69cbd45 New ?_sql_time_limit_ms=10 argument to database and table page
Allows callers to opt for a lower time limit.

Closes #95
2017-11-14 18:55:10 -08:00
Simon Willison 0b8c1b0a6d Test for sql_time_limit_ms + sqlite_functions mechanism
Added a unit test for the sql_time_limit_ms option.

To test this, I needed to add a custom SQLite sleep() function. I've added a
simple mechanism to the Datasette class for registering custom functions.

I also had to modify the sqlite_timelimit() function. It makes use of a magic
value, N, which is the number of SQLite virtual machine instructions that
should execute in between calls to my termination decision function.

The value of N was not finely grained enough for my test to work - so I've
added logic that says that if the time limit is less than 50ms, N is set to 1.
This got the tests working.

Refs #95
2017-11-14 18:43:34 -08:00
Simon Willison cbb59e3801 Handle tables with names that start with digits 2017-11-14 18:03:21 -08:00
Simon Willison 50e817801f Fixed #83
Turns out we had a redirect bug as well.
2017-11-13 16:44:43 -08:00
Simon Willison 44a199a062 Stop using sqlite WITH RECURSIVE in our tests
The version of Python 3 running in Travis CI doesn't support this.
2017-11-13 14:15:21 -08:00
Simon Willison 847f3e0c92 Implemented offset/limit pagination for views
Closes #70
2017-11-13 13:10:55 -08:00
Simon Willison 7dac1c05cd Improved pagination
Closes #78
2017-11-13 12:34:56 -08:00
Simon Willison 8252e71da4 Limit on max rows returned, controlled by --max_returned_rows option
If someone executes 'select * from table' against a table with a million rows
in it, we could run into problems: just serializing that much data as JSON is
likely to lock up the server.

Solution: we now have a hard limit on the maximum number of rows that can be
returned by a query. If that limit is exceeded, the server will return a
`"truncated": true` field in the JSON.

This limit can be optionally controlled by the new `--max_returned_rows`
option. Setting that option to 0 disables the limit entirely.

Closes #69
2017-11-13 11:33:01 -08:00
Simon Willison 26370b14d8 Handle table names with slashes in them
e.g. https://datasette-wdlexdiaoz.now.sh/fivethirtyeight-75d605c/bob-ross%2Felements-by-episode.csv?CABIN=1&BUSHES=1&CLOUDS=1
2017-11-12 15:17:00 -08:00
Simon Willison 666aa03253 Improved error handling
Invalid SQL now shows a special error.html template, and is covered by tests.
2017-11-12 13:16:15 -08:00
Simon Willison ff2ab9dc7d Views now show their SQL, are handled a bit better
Refs #66
2017-11-12 12:32:25 -08:00
Simon Willison 8acdc2fd14 Test for table with space in name
Tests code in b51836f846
2017-11-12 12:08:32 -08:00
Simon Willison 59580d02da Implemented custom SQL via textarea
Closes #65
2017-11-11 18:35:35 -08:00
Simon Willison fa42a56c6a Bulked out table test a bit
I'm closing #50 - more tests will be added in the future, but the framework
is neatly in place for them now.
2017-11-11 14:22:47 -08:00
Simon Willison e9e1def4c0 Revised JSON design a bit
Closes #63
2017-11-11 14:20:00 -08:00
Simon Willison 407795b612 Initial unit tests against our Sanic app
Refs #50

I had to disable the build metadata function to get these tests to work
sensibly. I need to completely rethink how that mechanism works.
2017-11-11 09:47:59 -08:00
Simon Willison 3280972c89 Fixed tests I broke earlier
Broke these tests in 21c9c04310
2017-11-11 08:52:17 -08:00
Simon Willison 21c9c04310 Implemented cursor-based pagination for table view
Closes #5
2017-11-10 12:41:14 -08:00
Simon Willison a8a293cd71 Refactored util functions into new utils module 2017-11-10 11:25:54 -08:00
Simon Willison 40d3b3eae6 Refactored tests into new tests/ folder
Guided by https://docs.pytest.org/en/latest/goodpractices.html
2017-11-10 10:48:16 -08:00