Comments (10)
Sorry, to add more detail I'm running this on: Django==1.11.7
and MonkeyType==17.12.2
.
from monkeytype.
The test runner could affect this; for example, when using --parallel
with the default test runner, and parallel test execution is enabled by default in Django 1.11:
--parallel [N]
Runs tests in separate parallel processes. Since modern processors have multiple cores, this allows running tests significantly faster.
By default --parallel runs one process per core according to multiprocessing.cpu_count(). You can adjust the number of processes either by providing it as the option’s value, e.g. --parallel=4, or by setting the DJANGO_TEST_PROCESSES > environment variable.
If my theory is correct, then MonkeyType whould be tracing just the main test supervisor process, which is (I guess) Django-only code.
@nsillik Can you try running the tests with just one process?
from monkeytype.
@carljm I came back to say just that, a note about this "gotcha" would be really appreciated by newcomers, specially because Django has this behavior enabled by default, and most likely people will try out this tool by running unit tests in a local development environment.
BTW, thanks for opensourcing this!
from monkeytype.
FAQ entry added: http://monkeytype.readthedocs.io/en/latest/faq.html
from monkeytype.
Do you get an error or any output at all from monkeytype run
?
from monkeytype.
Closing for now since there's not enough information here to do any debugging; will reopen if we get full paste of shell session, with all output.
Most likely issue is that you are hitting #28.
from monkeytype.
Other than some warnings generated by my tests, there's no output that seems like it's from monkeytype
:
» monkeytype run manage.py test
Creating test database for alias 'default'...
System check identified some issues:
WARNINGS:
?: (django_mysql.W003) The character set is not utf8mb4 for database connection 'default'
HINT: The default 'utf8' character set does not include support for all Unicode characters. It's strongly recommended you move to use 'utf8mb4'. See: https://django-mysql.readthedocs.io/en/latest/checks.html#django-mysql-w003-utf8mb4
System check identified 1 issue (0 silenced).
............/Users/nsillik/Development/mado/mado-api/mado_api/util/paginator.py:9: UnorderedObjectListWarning: Pagination may yield inconsistent results with an unordered object_list: <class 'mado_api.device.models.DeviceConnection'> QuerySet.
paginator = Paginator(qs, numResults)
..................................................................
----------------------------------------------------------------------
Ran 78 tests in 10.033s
OK
Destroying test database for alias 'default'...
from monkeytype.
That's odd. Do you have a monkeytype_config.py
? Or have you set the MT_DB_PATH
environment variable?
from monkeytype.
@mandx monkeytype run ./manage.py test --parallel 1
generated a sqllite file!
I'm still not able to generate stubs, but I think that's a separate issue.
@carljm I do not have a monkeytype_config.py
or MT_DB_PATH
variable set.
I'm going to close this while I see what the issue with stub generation is. Thanks for your help!
from monkeytype.
Thanks for identifying the problem, @mandx ! I'll add an entry about this issue to the FAQ.
from monkeytype.
Related Issues (20)
- ValueError: source code string cannot contain null bytes
- New release HOT 2
- Compare observed types to existing type annotations HOT 1
- Empty lists result in overly broad types HOT 1
- Issue with Callable type for < Python 3.9 HOT 3
- Better documentation for how to use MonkeyType with multiple processes/threads HOT 3
- Collect types for non-module functions HOT 1
- provide a type rewriter to find common base class HOT 5
- how open Instagram without password
- Adding an index to monkeytype.sqlite3 speeds up stub generation HOT 1
- Keyword-only arguments are not captured in traces
- Calls to locally defined functions are not captured
- `*args` and `**kwargs` are not captured in traces HOT 1
- Add pre-commit support HOT 1
- `AttributeError: 'ellipsis' object has no attribute '__qualname__'` HOT 1
- pep_563 flag creates imports that don't match the usage of the name HOT 4
- Support PEP 585 - list[int] instead of typing.List[int]
- Stubs with positional-only args output too many slashes and cause a SyntaxError
- Error when parameter in external file is class defined in `__main__` HOT 1
- Return type not traced when returning constant (Python ≥ 3.12)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from monkeytype.