Name | impall JSON |
Version |
1.5.3
JSON |
| download |
home_page | https://github.com/rec/impall |
Summary | 🛎 Test-import all modules 🛎 |
upload_time | 2024-01-25 13:24:46 |
maintainer | |
docs_url | None |
author | Tom Ritchford |
requires_python | >=3.8 |
license | |
keywords |
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
|
coveralls test coverage |
No coveralls.
|
# 🛎 Test-import all modules 🛎
Individually and separately imports each Python module or file in a project and
reports warnings or failures at the end.
### Running impall as a unit test
Just inherit from the base class and it will
automatically find and import each file, like this.
import impall
class ImpAllTest(impall.ImpAllTest):
pass
(You can copy
[this file](https://github.com/rec/impall/blob/master/all_test.py)
into your project if you like.)
Tests are customized by overriding one of these following properties in the
derived class.
CLEAR_SYS_MODULES, EXCLUDE, FAILING, INCLUDE, MODULES, PATHS,
RAISE_EXCEPTIONS, and WARNINGS_ACTION.
For example, to turn warnings into errors, set the property
WARNINGS_ACTION in the derived class definition, like this.
class ImpAllTest(impall.ImpAllTest):
WARNINGS_ACTION = 'error'
## Running impall as a command-line utility
$ impall --warnings_action=error
$ impall -w error
The properties INCLUDE, EXCLUDE, and PROJECT_PATH can be
lists of strings, or a string separated with colons like
'foo.mod1:foo.mod2'
INCLUDE and EXCLUDE match modules, and also allow * as a wildcard.
A single * matches any module segment, and a double ** matches any
remaining segments. For example,
`INCLUDE = 'foo', 'bar.*', 'baz.**'`
* matches `foo` but not `foo.foo`
* matches `bar.foo` but not `bar` or `bar.foo.bar`
* matches `baz.foo` as well as `baz.foo.bar` but not `baz`
### A note on side-effects
to reduce side-effects, `sys.modules` is restored to its original
condition after each import if CLEAR_SYS_MODULES is true, but there might be
other side-effects from loading some specific module.
Use the EXCLUDE property to exclude modules with undesirable side
effects. In general, it is probably a bad idea to have significant
side-effects just from loading a module.
### [API Documentation](https://rec.github.io/impall#impall--api-documentation)
Raw data
{
"_id": null,
"home_page": "https://github.com/rec/impall",
"name": "impall",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "",
"author": "Tom Ritchford",
"author_email": "tom@swirly.com",
"download_url": "https://files.pythonhosted.org/packages/bc/d2/73d301539dfb398c3ccba94e2ff3812bfb1b87f62be1024173ecc6e12b01/impall-1.5.3.tar.gz",
"platform": null,
"description": "# \ud83d\udece Test-import all modules \ud83d\udece\n\nIndividually and separately imports each Python module or file in a project and\nreports warnings or failures at the end.\n\n### Running impall as a unit test\n\nJust inherit from the base class and it will\nautomatically find and import each file, like this.\n\n import impall\n\n class ImpAllTest(impall.ImpAllTest):\n pass\n\n(You can copy\n[this file](https://github.com/rec/impall/blob/master/all_test.py)\ninto your project if you like.)\n\nTests are customized by overriding one of these following properties in the\nderived class.\n\n CLEAR_SYS_MODULES, EXCLUDE, FAILING, INCLUDE, MODULES, PATHS,\n RAISE_EXCEPTIONS, and WARNINGS_ACTION.\n\nFor example, to turn warnings into errors, set the property\nWARNINGS_ACTION in the derived class definition, like this.\n\n class ImpAllTest(impall.ImpAllTest):\n WARNINGS_ACTION = 'error'\n\n## Running impall as a command-line utility\n\n $ impall --warnings_action=error\n $ impall -w error\n\nThe properties INCLUDE, EXCLUDE, and PROJECT_PATH can be\nlists of strings, or a string separated with colons like\n'foo.mod1:foo.mod2'\n\nINCLUDE and EXCLUDE match modules, and also allow * as a wildcard.\nA single * matches any module segment, and a double ** matches any\nremaining segments. For example,\n\n`INCLUDE = 'foo', 'bar.*', 'baz.**'`\n\n* matches `foo` but not `foo.foo`\n* matches `bar.foo` but not `bar` or `bar.foo.bar`\n* matches `baz.foo` as well as `baz.foo.bar` but not `baz`\n\n### A note on side-effects\n\nto reduce side-effects, `sys.modules` is restored to its original\ncondition after each import if CLEAR_SYS_MODULES is true, but there might be\nother side-effects from loading some specific module.\n\nUse the EXCLUDE property to exclude modules with undesirable side\neffects. In general, it is probably a bad idea to have significant\nside-effects just from loading a module.\n\n### [API Documentation](https://rec.github.io/impall#impall--api-documentation)\n",
"bugtrack_url": null,
"license": "",
"summary": "\ud83d\udece Test-import all modules \ud83d\udece",
"version": "1.5.3",
"project_urls": {
"Documentation": "https://rec.github.io/impall",
"Homepage": "https://github.com/rec/impall",
"Repository": "https://github.com/rec/impall"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "968f5feffe82d861c57b89a2482019883a4fb982158f3cd56c75ce085c2fe743",
"md5": "99edb881c3ad467f38f254405caf1f3f",
"sha256": "c3c8b1e7b13ba547f9073309acd6388242c7cace49b27f9f05caff04ad02baf0"
},
"downloads": -1,
"filename": "impall-1.5.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "99edb881c3ad467f38f254405caf1f3f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 7029,
"upload_time": "2024-01-25T13:24:44",
"upload_time_iso_8601": "2024-01-25T13:24:44.965114Z",
"url": "https://files.pythonhosted.org/packages/96/8f/5feffe82d861c57b89a2482019883a4fb982158f3cd56c75ce085c2fe743/impall-1.5.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "bcd273d301539dfb398c3ccba94e2ff3812bfb1b87f62be1024173ecc6e12b01",
"md5": "3f99f8e5b92772cb574ebbe2f261af77",
"sha256": "58d420ac9070db04a15ea39d75dddf2ab8cd3fd340a1d23bf9a4187184dab9ee"
},
"downloads": -1,
"filename": "impall-1.5.3.tar.gz",
"has_sig": false,
"md5_digest": "3f99f8e5b92772cb574ebbe2f261af77",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 5764,
"upload_time": "2024-01-25T13:24:46",
"upload_time_iso_8601": "2024-01-25T13:24:46.235099Z",
"url": "https://files.pythonhosted.org/packages/bc/d2/73d301539dfb398c3ccba94e2ff3812bfb1b87f62be1024173ecc6e12b01/impall-1.5.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-25 13:24:46",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "rec",
"github_project": "impall",
"travis_ci": true,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "impall"
}