Git Product home page Git Product logo

Comments (10)

nsillik avatar nsillik commented on May 23, 2024 1

Sorry, to add more detail I'm running this on: Django==1.11.7 and MonkeyType==17.12.2.

from monkeytype.

mandx avatar mandx commented on May 23, 2024 1

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.

mandx avatar mandx commented on May 23, 2024 1

@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.

carljm avatar carljm commented on May 23, 2024 1

FAQ entry added: http://monkeytype.readthedocs.io/en/latest/faq.html

from monkeytype.

carljm avatar carljm commented on May 23, 2024

Do you get an error or any output at all from monkeytype run?

from monkeytype.

carljm avatar carljm commented on May 23, 2024

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.

nsillik avatar nsillik commented on May 23, 2024

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.

carljm avatar carljm commented on May 23, 2024

That's odd. Do you have a monkeytype_config.py? Or have you set the MT_DB_PATH environment variable?

from monkeytype.

nsillik avatar nsillik commented on May 23, 2024

@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.

carljm avatar carljm commented on May 23, 2024

Thanks for identifying the problem, @mandx ! I'll add an entry about this issue to the FAQ.

from monkeytype.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.