Commit Graph

20 Commits

Author SHA1 Message Date
M. Zulqarnain
e505d99237 pyupgrade on lms gating and grades apps (#26532) 2021-02-22 12:58:41 +05:00
Aarif
906b6f7fed replaced unittest assertions pytest assertions (19) (#26545) 2021-02-18 18:00:30 +05:00
M. Zulqarnain
0213fde968 BOM-2281 : Pylint amnesty for grades,gating and instructor app (#26343)
* pyint amnesty for grades,gating and instructor app
2021-02-03 18:14:35 +05:00
Kyle McCormick
151bd13666 Use full names for common.djangoapps imports; warn when using old style (#25477)
* Generate common/djangoapps import shims for LMS
* Generate common/djangoapps import shims for Studio
* Stop appending project root to sys.path
* Stop appending common/djangoapps to sys.path
* Import from common.djangoapps.course_action_state instead of course_action_state
* Import from common.djangoapps.course_modes instead of course_modes
* Import from common.djangoapps.database_fixups instead of database_fixups
* Import from common.djangoapps.edxmako instead of edxmako
* Import from common.djangoapps.entitlements instead of entitlements
* Import from common.djangoapps.pipline_mako instead of pipeline_mako
* Import from common.djangoapps.static_replace instead of static_replace
* Import from common.djangoapps.student instead of student
* Import from common.djangoapps.terrain instead of terrain
* Import from common.djangoapps.third_party_auth instead of third_party_auth
* Import from common.djangoapps.track instead of track
* Import from common.djangoapps.util instead of util
* Import from common.djangoapps.xblock_django instead of xblock_django
* Add empty common/djangoapps/__init__.py to fix pytest collection
* Fix pylint formatting violations
* Exclude import_shims/ directory tree from linting
2020-11-10 07:02:01 -05:00
DawoudSheraz
0b1c7db967 add multiple correct values check for Dropdown problems 2020-02-10 11:36:28 +05:00
Feanil Patel
6e3fe00fff Fix all E303 pep8 errors. 2019-12-30 12:25:38 -05:00
Feanil Patel
9cf2f9f298 Run 2to3 -f future . -w
This will remove imports from __future__ that are no longer needed.

https://docs.python.org/3.5/library/2to3.html#2to3fixer-future
2019-12-30 10:35:30 -05:00
Stu Young
22856fdc1a INCR-315 (#20610): python-modernize lms/djangoapps/grades/tests
* run python modernize
* run isort
* fix pylint issues
2019-05-28 11:21:34 -04:00
Michael Youngstrom
3221c2b91f Remove lms pytest shards 2019-02-12 11:03:46 -05:00
Jeremy Bowman
1a5bf35357 TE-2689 Remove useless pylint suppressions part 2 2018-08-14 17:39:02 -04:00
Stuart Young
1fd2167144 rebalance python unittests onto new shards 2018-05-03 11:16:05 -04:00
Andy Armstrong
79acb5c5be Reorder LMS imports using isort 2017-06-11 21:48:06 -04:00
David Ormsbee
2051c90924 Test Speedup: Isolate Modulestore Signals
There are a number of Django Signals that are on the modulestore's
SignalHandler class, such as SignalHandler.course_published. These
signals can trigger very expensive processes to occur, such as course
overview or block structures generation. Most of the time, the test
author doesn't care about these side-effects.

This commit does a few things:

* Converts the signals on SignalHandler to be instances of a new
  SwitchedSignal class, that allows signal sending to be disabled.

* Creates a SignalIsolationMixin helper similar in spirit to the
  CacheIsolationMixin, and adds it to the ModuleStoreIsolationMixin
  (and thus to ModuleStoreTestCase and SharedModuleStoreTestCase).

* Converts our various tests to use this new mechanism. In some cases,
  this means adjusting query counts downwards because they no longer
  have to account for publishing listener actions.

Modulestore generated signals are now muted by default during test runs.
Calls to send() them will result in no-ops. You can choose to enable
specific signals for a given subclass of ModuleStoreTestCase or
SharedModuleStoreTestCase by specifying an ENABLED_SIGNALS class
attribute, like the following example:

    from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase

    class MyPublishTestCase(ModuleStoreTestCase):
        ENABLED_SIGNALS = ['course_published', 'pre_publish']

You should take great care when disabling signals outside of a
ModuleStoreTestCase or SharedModuleStoreTestCase, since they can leak
out into other tests. Be sure to always clean up, and never disable
signals outside of testing. Because signals are essentially process
globals, it can have a lot of unpleasant side-effects if we start
mucking around with them during live requests.

Overall, this change has cut the total test execution time for
edx-platform by a bit over a third, though we still spend a lot in
pre-test setup during our test builds.

[PERF-413]
2017-02-23 10:31:16 -05:00
Nimisha Asthagiri
99e6d53939 Preload definitions when collecting block structures 2016-12-29 08:51:26 -05:00
Sanford Student
44074f30a2 move course version repopulation to runtime layer
for TNL-6065
2016-12-06 10:22:13 -05:00
Sanford Student
9209eef7e2 add grading policy hash to transformer 2016-10-19 11:35:51 -04:00
Nimisha Asthagiri
47e556c7f5 Use explicit 'graded' value so grades are immune to subsection's value
TNL-5560
2016-09-16 08:31:30 -04:00
Eric Fischer
31953c5e0c Update correct persistent score
* First take at forcing a subsection's grade to update when a signal is
  sent that a problem's score has changed
* Refactor signal handler connection.
* Expand bokchoy tests to cover progress page
* Add some grading unit tests

TNL-5394
TNL-5364
2016-09-08 15:09:05 -04:00
Nimisha Asthagiri
9616ac99f8 Expose course_version from Split Modulestore;
Support subtree_edited_on and course_version fields in BlockStructures
TNL-5010
2016-07-26 13:40:53 -04:00
Nimisha Asthagiri
1ada5c3487 Create Grades djangoapp
https://openedx.atlassian.net/browse/TNL-5008
2016-07-22 00:09:43 -04:00