Best Python code snippet using nose
greyhame.py
Source:greyhame.py
1greyhame_description = \2u"""3nose collects tests automatically from python source files, directories and4packages found in its working directory (which defaults to the current working5directory). Any python source file, directory or package that matches the6testMatch regular expression (by default: (?:^|[b_.-])[Tt]est) will be7collected as a test (or source for collection of tests). In addition, all8other packages found in the working directory will be examined for python9source files or directories that match testMatch. Package discovery descends10all the way down the tree, so package.tests and package.sub.tests and11package.sub.sub2.tests will all be collected.12Within a test directory or package, any python source file matching testMatch13will be examined for test cases. Within a test module, functions and classes14whose names match testMatch and TestCase subclasses with any name will be15loaded and executed as tests. Tests may use the assert keyword or raise16AssertionErrors to indicate test failure. TestCase subclasses may do the same17or use the various TestCase methods available.18"""19greyhame_compdesc = \20[21u"""22Oftentimes when testing you will want to select tests based on criteria rather23then simply by filename. For example, you might want to run all tests except24for the slow ones. You can do this with the Attribute selector plugin by25setting attributes on your test methods.26""",27u"""28This plugin captures stdout during test execution. If the test fails or raises29an error, the captured output will be appended to the error or failure output.30It is enabled by default but can be disabled with the options -s or31--nocapture.32""",33u"""34If you have Ned Batchelder's coverage module installed, you may activate a35coverage report with the --with-coverage switch or NOSE_WITH_COVERAGE36environment variable. The coverage report will cover any python source module37imported after the start of the test run, excluding modules that match38testMatch. If you want to include those modules too, use the --cover-tests39switch, or set the NOSE_COVER_TESTS environment variable to a true value. To40restrict the coverage report to modules from a particular package or packages,41use the --cover-packages switch or the NOSE_COVER_PACKAGES environment42variable.43""",44u"""45This plugin provides --pdb and --pdb-failures options. The --pdb option will46drop the test runner into pdb when it encounters an error. To drop into pdb on47failure, use --pdb-failures.48""",49u"""50Isolation works only during lazy loading. In normal use, this is only during51discovery of modules within a directory, where the process of importing,52loading tests and running tests from each module is encapsulated in a single53loadTestsFromName call. This plugin implements loadTestsFromNames to force the54same lazy-loading there, which allows isolation to work in directed mode as55well as discovery, at the cost of some efficiency: lazy-loading names forces56full context setup and teardown to run for each name, defeating the grouping57that is normally used to ensure that context setup and teardown are run the58fewest possible times for a given set of names.59""",60]61greyhame_mstndesc = \62[63u"""64# Added multiprocess plugin that allows tests to be run in parallel across multiple processes.65# Added logcapture plugin that captures logging messages and prints them with failing tests. Thanks to Max Ischenko for the implementation.66# Added optional HTML coverage reports to coverage plugin. Thanks to Augie Fackler for the patch.67# Added plugin that enables collection of tests in all modules. Thanks to Peter Fein for the patch (#137).68# Added --failed option to testid plugin. When this option is in effect, if any tests failed in the previous test run (so long as testid was active for that test run) only the failed tests will run.69""",70u"""71# Added versioned nosetests scripts (#123).72# Fixed bug that would cause context teardown to fail to run in some cases. Thanks to John Shaw for the bug report and patch (#234).73# Enabled doctest plugin to use variable other than "_" as the default result variable. Thanks to Matt Good for the patch (#163).74# Fixed bug that would cause unicode output to crash output capture. Thanks to schickb for the bug report (#227).75# Added setUp and tearDown as valid names for module-level fixtures. Thanks to AgilityNerd for the patch (#211).76# Fixed bug in list of valid names for package-level fixtures. Thanks to Philip Jenvey for the patch (#237).77# Updated man page generation using hacked up manpage writer from docutils sandbox. Thanks grubert@users.sourceforge.net for the original module.78""",79u"""80# Fixed bug in nose.tools.with_setup that prevented use of multiple @with_setup decorators. Thanks to tlesher for the bug report (#151).81# Fixed bugs in handling of context fixtures for tests imported into a package. Thanks to Gary Bernhardt for the bug report (#145).82# Fixed bugs in handling of config files and config file options for plugins excluded by a RestrictedPluginManager. Thanks to John J Lee and Philip Jenvey for the bug reports and patches (#158, #166).83# Updated ErrorClass exception reporting to be shorter and more clear. Thanks to John J Lee for the patch (#142).84# Allowed plugins to load tests from modules starting with '_'. Thanks to John J Lee for the patch (#82).85# Updated documentation about building as rpm (#127).86# Updated config to make including executable files the default on IronPython as well as on Windows. Thanks to sanxiyn for the bug report and patch (#183).87""",88u"""89# Fixed a python 2.3 incompatibility in errorclass_failure.rst (#173). Thanks to Philip Jenvey for the bug report and patch.90# Fixed bug in adapting 0.9 plugins to 0.10 (#119 part one). Thanks to John J Lee for the bug report and tests.91# Fixed bug in handling of argv in config and plugin test utilities (#119 part two). Thanks to John J Lee for the bug report and patch.92# Fixed bug where Failure cases due to invalid test name specifications were passed to plugins makeTest (#120). Thanks to John J Lee for the bug report and patch.93# Fixed bugs in doc css that mangled display in small windows. Thanks to Ben Hoyt for the bug report and Michal Kwiatkowski for the fix.94# Made it possible to pass a list or comma-separated string as defaultTest to main(). Thanks to Allen Bierbaum for the suggestion and patch.95# Fixed a bug in nose.selector and nose.util.getpackage that caused directories with names that are not legal python identifiers to be collected as packages (#143). Thanks to John J Lee for the bug report.96""",97u"""98# Fixed bug that broke plugins with names containing underscores or hyphens. Thanks to John J Lee for the bug report and patch (Issue #81).99# Fixed typo in nose.__all__. Thanks to John J Lee for the bug report.100# Fixed handling of test descriptions that are multiline docstrings. Thanks to James Casbon for the patch (Issue #50).101# Improved documentation of doctest plugin to make it clear that entities may have doctests, or themselves be tests, but not both. Thanks to John J Lee for the bug report and patch (Issue #84).102# Made __file__ available in non-python-module doctests.103# Fixed bug that made it impossible for plugins to exclude package directories from test discovery (Issue #89). Thanks to John J Lee for the bug report and patch.104""",105]106greyhame_verdesc = \107[108u"""109* Fixed bug in xunit plugin xml escaping. Thanks to Nat Williams for the bug report (#266).110* Fixed bug in xunit plugin that could cause test run to crash after certain types of errors or actions by other plugins.111* Fixed bug in testid plugin that could cause test run to crash after certain types of errors or actions by other plugins.112* Fixed bug in collect only plugin that caused it to fail when collecting from test generators.113* Fixed some broken html in docs.114""",115u"""116* Made it possible to 'yield test' in addition to 'yield test,' from test generators. Thanks to Chad Whitacre for the patch (#230).117* Fixed bug that caused traceback inspector to fail when source code file could not be found. Thanks to Philip Jenvey for the bug report and patch (#236).118* Fixed some issues limiting compatibility with IronPython. Thanks to Kevin Mitchell for the patch.119* Added support for module and test case fixtures in doctest files (#60).120* Added --traverse-namespace commandline option that restores old default behavior of following all package __path__ entries when loading tests from packages. Thanks to Philip Jenvey for the patch (#167).121* Added --first-package-wins commandline option to better support testing parts of namespace packages. Thanks to Jason Coombs for the bug report (#197).122""",123u"""124* nose is now compatible with python 2.6.125* Fixed bug in nosetests setup command that caused an exception to be raised if run with options. Thanks to Philip Jenvey for the bug report (#191).126* Raised score of coverage plugin to 200, so that it will execute before default-score plugins, and so be able to catch more import-time code. Thanks to Ned Batchelder for the bug report and patch (#190).127* nose now runs under jython (jython svn trunk only at this time). Thanks to Philip Jenvey, Pam Zerbinos and the other pycon sprinters (#160).128* Fixed bugs in loader, default plugin manager, and other modules that caused plugin exceptions to be swallowed (#152, #155). Thanks to John J Lee for the bug report and patch.129* Added selftest.py script, used to test a non-installed distribution of nose (#49). Thanks to Antoine Pitrou and John J Lee for the bug report and patches.130* Fixed bug in nose.importer that caused errors with namespace packages. Thanks to Philip Jenvey for the bug report and patch (#164).131""",132u"""133* Classes with metaclasses can now be collected as tests (#153).134* Made sure the document tree in the selector plugin test is accurate and tested (#144). Thanks to John J Lee for the bug report and patch.135* Fixed stack level used when dropping into pdb in a doctest (#154). Thanks to John J Lee for the bug report and patch.136* Fixed bug in ErrorClassPlugin that made some missing keyword argument errors obscure (#159). Thanks to Philip Jenvey for the bug report and patch.137* Fixed bug in capture plugin that caused it to record captured output on the test in the wrong attribute (#113).138* Fixed bug in result proxy that caused tests to fail if they accessed certain result attibutes directly (#114). Thanks to Neilen Marais for the bug report.139""",140u"""141* Fixed bug in capture plugin that caused other error formatters changes to be lost if no output was captured (#124). Thanks to someone at ilorentz.org for the bug report.142* Fixed several bugs in the nosetests setup command that made some options unusable and the command itself unusable when no options were set (#125, #126, #128). Thanks to Alain Poirier for the bug reports.143* Fixed bug in handling of string errors (#130). Thanks to schl... at uni-oldenburg.de for the bug report.144* Fixed bug in coverage plugin option handling that prevented --cover-package=mod1,mod2 from working (#117). Thanks to Allen Bierbaum for the patch.145* Fixed bug in profiler plugin that prevented output from being produced when output capture was enabled on python 2.5 (#129). Thanks to James Casbon for the patch.146""",147]148greyhame_comments = \149[150u"""151Additional changelog bits152""",153u"""154Updated changelog for 0.11.1 bugfix release155""",156u"""157Bumped version158""",159u"""160: last commit forgot single & double quoting. Also added a few more tests to catch both of these better.161""",162u"""163Fixed : Xunit plugin had its bracket escapes swapped. oops!164""",165u"""166Fixed bug collect only vs generator tests167""",168u"""169Merged Kumar's fixes170""",171u"""172Whitespace173""",174u"""175A less likely case but fixes early failures and/or successes sent to Xunit where startTest may not be called. Fixes AttributeError176""",177u"""178Bumped version179""",180u"""181Making testid plugin more defensive to early errors (before startTest()). Fixes KeyError182""",183u"""184In the face of an early error (probably raises in setup()), the Xunit plugin sets test time to 0. Fixes AttributeError bug185""",186u"""187Fixed broken html188""",189u"""190Corrected download link191""",192u"""193Fixed setup.cfg.release, was out of sync w/setup.cfg194""",195u"""196Added nose/usage.txt to manifest197""",198u"""199Added selftest.py to manifest200""",201u"""202release script/manifest improvements203""",204u"""205Disabled multiprocess for windows, noted in docs that it is not available on windows206""",207u"""208ignore build files209""",210u"""211Made import safe212""",213u"""214Added another debug log statement, may help tracking down 215""",216u"""217Revised mkrelease to build in clone218""",219u"""220Doc updates221""",222u"""223pypi info updated224""",225u"""226jython test fix227""",228u"""229Tweakin the docs230""",231u"""232Missed changes from merge, other tweaks233""",234u"""235Doc tweaks236""",237u"""238Merged Pam's documentation updates239""",240u"""241minor spag tweaks242""",243u"""244small tweaks for consistency245""",246u"""247fixed a lot of broken links, did some formatting consistency stuff248""",249u"""250fixing broken link by pulling in the nose.commands stuff251""",252u"""253typos and punctuation254""",255u"""256missed a colon257""",258u"""259i spilled some red ink on the plugin documentation.260""",261u"""262apparently i have an uncommitted merge263""",264u"""265Improved param formatting266""",267u"""268tweaks for clarity in some plugins269""",270u"""271clarity272""",273u"""274Stray whitespace275""",276u"""277Updated mkrelease to handle branching and tagging better.278""",279u"""280adding istest and nottest to __all__ so their docstrings get pulled for the docs281""",282u"""283grammatical tweaks to usage.txt284""",285u"""286Clarified plugin api change in 0.11, compatibility with 0.10 and 0.9287""",288u"""289Updated outdated docstrings290""",291u"""292Updated with hg urls, better explanations of what version is where293""",294u"""295Fixed #143296""",297u"""298Missed test update in transition299""",300u"""301Made it possible to pass main(), run(), etc a list or comma-separated text as defaultTest.302""",303u"""304Added autogeneration of readme305""",306u"""307Removed rst2wiki.py, which is not used.308""",309u"""310Copy generated manpage to right place311""",312u"""313Turned off deprecation warning for string exceptions in string exception test.314""",315u"""316Improved option help display, some whitespace cleanups317""",318u"""319Updated CHANGELOG320""",321u"""322Removed some debug prints323""",324u"""325Fixed #120: applied patch.326""",327u"""328Work in progress on automated man page generation329""",330u"""331Normalize paths so windows tests have a chance of passing.332""",333u"""334Added community, old version links335""",336u"""337Provisional fix for #121338""",339u"""340Added basic contributing page341""",342u"""343Fixed #119 part 2344""",345u"""346Clarified differences between module/test doctest fixtures347""",348u"""349Fixed #119 -- first part.350""",351u"""352Added project index redirector, updated mkrelease353""",354u"""355Fixed #129. Applied patch with small backwards-compatibility change.356""",357u"""358Converted svn tags359""",360u"""361Fixed #117: applied patch with small modification.362""",363u"""364Examples are no longer doctests which makes them more readable. Also tightened up the prose while I was at it.365""",366u"""367Fixed #130368""",369u"""370Fixed for 2.3371""",372u"""373Updated CHANGELOG to include fixes for 125, 126 and 128374""",375u"""376Added section in plugin writing docs showing how to register a plugin without setuptools377""",378u"""379Fixed #128380""",381u"""382Fixing attrib plugin unit tests for 2.3 compatibility (removed decorators)383""",384u"""385Fixed #125386""",387u"""388Added an @attr decorator and better documentation for the Attribute plugin.389""",390u"""391Fixed #126392""",393u"""394Made sys.path adjustment more brutal to work around easy_install's viscious pth hacks395""",396u"""397Fixed #124398""",399u"""400Formatting fix401""",402u"""403Fixed #114. Updated CHANGELOG.404""",405u"""406Doc improvements407""",408u"""409Bumped version to 0.10.1410""",411u"""412Made test repeatable413""",414u"""415Fixed missing examples in release distribution.416""",417u"""418Restored loading tests from methods, for 2.6 compat419""",420u"""421Added coverage output file needed by doc builder. Added docs to Failure. Updated Failure to have usable address when possible so that testid can be used to retry. Added tests for that case.422""",423u"""424Fixed MANIFEST and noted a needed change in mkrelease after fixing 0.10.0 package.425""",426u"""427More, cleaner 2.6 compat in unit tests428""",429u"""430Added placeholder for documenting plugins page431""",432u"""433Fixed bad paths in mkrelease434""",435u"""436More 2.6 compat work437""",438u"""439Fixed bugs in testid, test suite440""",441u"""442Tweaked news and index template link.443""",444u"""445Further adventures in 2/3 compat446""",447u"""448Doc updates, some done some in progress449""",450u"""451Updated changelog, readme and news452""",453u"""454Working on 2.6 compatibility455""",456u"""457Updating, fixing symlink458""",459u"""460Regenerated docs461""",462u"""463Official supported for this release... in theory464""",465u"""466Added missing changelog entries for closed tickets467""",468u"""469Updated docs and doc generation to catch a few missing links.470""",471u"""472Added to make hg happy with empty dir473""",474u"""475add a csv report option to performance plugin476""",477u"""478Updated CHANGELOG and regenerated docs479""",480u"""481Renamed nosetests to nosetests3 to avoid clashes482""",483u"""484docstrings for all peformance plugin hooks485""",486u"""487Additional clarification of generators and fixtures488""",489u"""490A bit more script cleanup491""",492u"""493Removed nose.proxy import and proxy mocks from unit test mock library494""",495u"""496better option handling, PEP8 fixes, remove duplicated number of test reporting497""",498u"""499Fixed swapped docstrings500""",501u"""502Made testid plugin use a file in cwd instead of ~ by default.503""",504u"""505Fixed a few more test failures506""",507u"""508correct performance logger name509""",510u"""511A different way of getting a different sidebar on index512""",513u"""514Removed old docs515""",516u"""517Replaced globals mistakenly moved to main()518""",519u"""520Fixed a few more test failures, issues in assert inspector, testid plugin, result handling of test cases521""",522u"""523simple performance plugin that will rerun tests a given number of times and report min, avg, max times524""",525u"""526Some basic experiments with sphinxification527""",528u"""529Committed PyCon sprint work.530""",531u"""532Cleaned up mkwiki and mkdocs somewhat533""",534u"""535Revised method of attaching extra info (captured output, etc) to exceptions to enable exception chaining to continue to work536""",537u"""538create branch for ticket 20 - perfomance plugin539""",540u"""541Cut branch for work on sphinxed docs542""",543u"""544Work on making mkrelease less clunky.545""",546u"""547wantMethod() must take class, as class is no longer derivable from method. Plus other result-related fixes548""",549u"""550Fixed dependency loading in nosetests command551""",552u"""553Updated NEWS, docs, version in preparation for 0.10.0 final release.554""",555u"""556Removed dtcompat module, needed only by python 2.3557""",558u"""559Updated changelog560""",561u"""562Updated changelog and regenerated docs.563""",564u"""565Removed nose.proxy, put functionality into nose.result.566""",567u"""568Fixed (patch from pjenvey)569""",570u"""571Applied patch from #107, with small changes. Fixes #107.572""",573u"""574More work on fixing tests, cleaning up prints and such575""",576u"""577Fixed (patch from pjenvey)578""",579u"""580Fixed issue #109581""",582u"""583Fixed some doctests for 3.0584""",585u"""586Updated changelog587""",588u"""589Fixed issue #108590""",591u"""592Restored sorting of test cases593""",594u"""595Removed deprecated TestCollector class. Deprecated collector() function.596""",597u"""598A few more pylint tweaks.599""",600u"""601Fixed for 3.0602""",603u"""604Added to ignore605""",606u"""607A few more pylint fixes.608""",609u"""610A few more fixes. test_address(SomeClass.foo) is never going to work in 3.0, as SomeClass.foo is just a plain function with no reference to the class in which it is defined.611""",612u"""613Applied patch making namespace package path traversal optional614""",615u"""616Doc updates617""",618u"""619First batch of little fixes from pylint.620""",621u"""622ID plugin must open ids file in binary mode623""",624u"""625Made it possible to just "yield test" in test generators626""",627u"""628Updated multiprocess plugin docs629""",630u"""631Misc. small cleanups.632""",633u"""634Fixed float div635""",636u"""637Added tests for logcapture bugfix638""",639u"""640Fixed test errors641""",642u"""643Missed a new doc file.644""",645u"""646Some progress getting loader to work, some unit tests now passing647""",648u"""649Added some warnings about plugin interoperation650""",651u"""652Added to multiprocess plugin docs653""",654u"""655Rebuilt docs.656""",657u"""658First halting steps -- basically nothing works659""",660u"""661Started updating changelog662""",663u"""664Started on doctest describing how to use a doctest fixtures module665""",666u"""667Fixed some interlinking issues.668""",669u"""670Cut branch for py3k support671""",672u"""673Added basic support for using a fixtures module with a doctest file. This was required to allow multiprocess plugin doctest to gracefully degrade when processing module is not available.674""",675u"""676Moved nose.plugins.doctests.run to nose.plugins.plugintest. Updated tests. A few other tweaks and minor fixes.677""",678u"""679Removed coverage output dir680""",681u"""682Working on tests for multiprocess plugin: currently broken, need to be made conditional. Other tests also failing on 2.3/jython.683""",684u"""685Avoid deprecation warning under 2.5686""",687u"""688Small fixes689""",690u"""691Some files in wrong place692""",693u"""694nose.plugins.plugintest was excluded from doc generation.695""",696u"""697Removed jython class file698""",699u"""700Reorganized test support files701""",702u"""703Applied patch from issue #58.704""",705u"""706Applied patch from Augie Fackler implementing optional html coverage reports707""",708u"""709Added multiprocess functional test dir710""",711u"""712Added some debug logging and cleaned up some cruft.713""",714u"""715Note why mp test is skipped under 2.6 when mp is active716""",717u"""718Fixed some FIXMEs and removed some verbosity from debug log719""",720u"""721Clarified doc slightly.722""",723u"""724Fixed bug in logcapture plugin that set default filters to be [logging format]725""",726u"""727Added some module-level docs728""",729u"""730Made it easier to deal with tracebacks in plugin doctests (Issue #104) (patch applied).731""",732u"""733Fixed bug that caused SkipTests, etc, to be seen as errors on all but first batch processed by a runner in mp734""",735u"""736Preliminary work towards supporting shared context fixtures737""",738u"""739Updated changelog.740""",741u"""742Stopped mp test from running under 2.6 when mp is active. Fixed bug in unpacking of error class results in mp runner.743""",744u"""745Fixed bug in picking up env settings746""",747u"""748Updated profiler plugin to close profiler in finalize (may fix windows bug #103).749""",750u"""751Fixed bug in doctest fixture support that caused module fixtures to be called twice752""",753u"""754Added attempt at supporting --stop flag in mp runs755""",756u"""7572nd try at fixing one windows test failure.758""",759u"""760Tried to make mp test run under mp in 2.6. Failed, gave up.761""",762u"""763Fixed doctest plugin/tests so that testid works with doctests again, and tests reflect new test packaging764""",765u"""766Made loader unit test safer for windows (maybe).767""",768u"""769Applied patch from Augie Fackler to make import of processing lazy. Importing processing can cause stdin to freak out, at least on some platforms, so it should only be imported when needed.770""",771u"""772Added ability to set _multiprocess_can_split_ in a context to override default split behavior.773""",774u"""775changed import paths so that xml plugin tests all pass776""",777u"""778Fixed typo in changelog779""",780u"""781somehow this pyc file got checked in and every time I run nose it shows up as modified even though I have a global ignore set on all pyc files. hmm. Deleting it!782""",783u"""784Fixed issues with doctests of properties; made doctest suites non-splittable785""",786u"""787updated comments with missing instructions on getting selftest.py to work788""",789u"""790Updated changelog with latest bug fixes.791""",792u"""793applied patch from Augie Fackler -- syntax fix (missing parens) that was generating a SyntaxError warning in 2.6794""",795u"""796Fixed silly bugs in errorclass consolidation797""",798u"""799committing Paul Davis' work from http://python-nosexml.googlecode.com/svn/trunk up to revision 18 (nosexml 0.2)800""",801u"""802Fixed issue #101.803""",804u"""805added more accurate help text for --match and --include options806""",807u"""808Able to execute selftest, excluding twisted tests, but still in a primitive state809""",810u"""811creating work branch for : a builtin XML plugin812""",813u"""814Fixed issue #100.815""",816u"""817Progress, but still broken -- failures errors etc cause test run to wedge818""",819u"""820Fixed issues with python 2.6 compatiblity821""",822u"""823Fixed #97: accepted environment.patch to make env usage consistent.824""",825u"""826Minor tweaks/debug -- still broken and noisy827""",828u"""829Merged multiprocess plugin branch (830""",831u"""832Fixed issue #98: loader can now accept selector class or instance in selector argument.833""",834u"""835Basic but very broken (and noisy!) multiprocess implementation836""",837u"""838rewrote and expanded help strings for logcapture839""",840u"""841Fixed a typo, updated TODO and regenerated docs.842""",843u"""844Started work on multiprocess plugin845""",846u"""847removed forgotten print statement848""",849u"""850Changed wording851""",852u"""853Corrected typo.854""",855u"""856Added hasFixtures method to context suite857""",858u"""859Applied patch from with minor changes for jython compatibility860""",861u"""862Added plugin example for injecting custom selector.863""",864u"""865Cut work branch for (parallel testing)866""",867u"""868implemented --logging-filter option to filter logging statements by loggers869""",870u"""871Cut branch for 0.10.4 (2.6 compat) release872""",873u"""874Fixed #96 with help from http://bugs.python.org/issue644744.875""",876u"""877Merged ticket-148 branch: added logcapture plugin. Bumped version to 0.11878""",879u"""880Release branch for 0.10.3881""",882u"""883Fixed issue #95.884""",885u"""886Updated for new release887""",888u"""889Minor doc tweaks.890""",891u"""892Updated CHANGELOG893""",894u"""895Finished init plugin example.896""",897u"""898Bumped score of cover plugin to 200, so it will execute before plugins with default score899""",900u"""901Doc updates902""",903u"""904Made Config() env default to {}. Fixed config.testNames getting clobbered by empty command line (issue #92) and made some usability changes to nose.plugins.doctests.run.905""",906u"""907Removed some cruft908""",909u"""910Fixed failing tests, added docs911""",912u"""913Fixed out-of-date docstring in TestProgram.createTests (issue #94).914""",915u"""916Added regression tests for 917""",918u"""919Added some basic help text920""",921u"""922Started work on 2nd example plugin doctest.923""",924u"""925Fixed #191. Regression test for #191 is still in progress.926""",927u"""928Supporting bits for loop-on-fail929""",930u"""931Release branch for 0.10.2932""",933u"""934Fixed typo.935""",936u"""937Added first cut at loop-on-fail mode to testid938""",939u"""940Updated for release941""",942u"""943Fixed a few more problems with the unwanted_package test. Added that test to the generated documentation, and tweaked doc generation and highlighting styles.944""",945u"""946Make hg happy947""",948u"""949* Fix issue #184 (sys.argv[0] treated as option)950""",951u"""952Added special run() function to nose.plugins.doctests to make it easier to write doctests that test test runs. Removed use of +ELLIPSIS in unwanted_package test.953""",954u"""955Started work on collect-only plugin956""",957u"""958minor update to attrib plugin docs, mentioning how quoting may be necessary for some shells (i.e. nosetests -a '!slow')959""",960u"""961Added two ideas for plugin example doctests to TODO.962""",963u"""964Cut branch for work on collect-only plugin for 0.11965""",966u"""967fixing test_address() so that it is compatible with unittest.TestCase classes which define __metaclass__ -- see http://code.google.com/p/python-nose/issues/detail?id=153968""",969u"""970Fixed #89. Added first plugin example doctest to functional_tests/doc_tests.971""",972u"""973Added some missing changelog updates974""",975u"""976Made __file__ available in globals of non-python-module doctests to facilitate functional doctests that need filesystem resources.977""",978u"""979Updated CHANGELOG980""",981u"""982Fixed (IronPython compatibility)983""",984u"""985Applied doc patch from #84 to improve documentation of doctest plugin.986""",987u"""988Fixed #127 (doc fix)989""",990u"""991Applied patch for issue #50 and extended it to work around unittest.TestCase bugs.992""",993u"""994Fixed another case where imported test gets wrong ancestors: selection of TestClass.test_method on commandline was not transplanting parent class.995""",996u"""997Fixed missing exec bit on non-setuptools nosetests script.998""",999u"""1000Add missing trailing newline to the standard test run report (it was removed accidentally in r479)1001""",1002u"""1003Fixed typo in nose.__all__.1004""",1005u"""1006Applied patch from1007""",1008u"""1009Removed done items from TODO1010""",1011u"""1012Applied updated patch from1013""",1014u"""1015Cleaned up implementation a bit1016""",1017u"""1018Added John J Lee to AUTHORS (ref: patch in issue #81).1019""",1020u"""1021Remove extraneous plugins argument from a ConfiguredDefaultsOptionParser method1022""",1023u"""1024Implemented function and class transplanting. Some cleanup left to do.1025""",1026u"""1027Applied patch from #81 to allow plugins with underscores or hypens in name.1028""",1029u"""1030Merged 158-166-config-files. Fixes #158 and #166.1031""",1032u"""1033Added failing functional tests for imported test fixtures and naming.1034""",1035u"""1036Changed nose.suite to use nose.util.isclass instead of inspect.isclass when introspecting contexts.1037""",1038u"""1039Merged 145-imported-test-fixtures.1040""",1041u"""1042Cut branch for work on1043""",1044u"""1045Fixed more upload bugs1046""",1047u"""1048Updated changelog with info on #151 fix1049""",1050u"""1051Fixed uploading bugs in release script.1052""",1053u"""1054Made new run() behavior optional, with deprecation warning. Changed config file parser interface to allow warning on excluded plugin options with a looser binding, rather than referencing plugins directly. Updated tests to use run_buffered where needed.1055""",1056u"""1057Updated NEWS and CHANGELOG and fixed a few more documentation goofs.1058""",1059u"""1060Fixed incorrect test for $JYTHON1061""",1062u"""1063Updated option parsing and restricted plugin manager to issue warnings when excluded plugin options are set in config files.1064""",1065u"""1066Started sketching token/tokenstream1067""",1068u"""1069Forgot to check in improved documentation1070""",1071u"""1072Merged 160-jython. Add test.sh shell script to run selftest under python2.3-2.5 and jython. Updated ls_tree and svn:ignore to ignore $py.class files.1073""",1074u"""1075Added remaining reporter methods. Changed progress* names to report*. Still a few failing tests due to plugin api changes.1076""",1077u"""1078Improved documentation.1079""",1080u"""1081Branching to '158-166-config-files'1082""",1083u"""1084Added unittest_reporter plugin, continued sketching new output system1085""",1086u"""1087Updated html example plugin to 0.10 api1088""",1089u"""1090Added changelog entry about jython compatibility.1091""",1092u"""1093Added placeholders for reporter classes1094""",1095u"""1096Fixed made it possible to call finalize() on plugins under all runs, made finalize() in capture plugin clean up stdout.1097""",1098u"""1099Fixed from 2.3 incompatibilties in ls_tree1100""",1101u"""1102Really set svn:ignore1103""",1104u"""1105Added test for (SkipTest used with python setup.py test). Fixed python 2.5 compat problem in some config tests.1106""",1107u"""1108Applied ls_tree patch from1109""",1110u"""1111trying to get svn to ignore .pyc files1112""",1113u"""1114Fixed module links and doctest blocks in wiki generation.1115""",1116u"""1117Moved plugin output test dir to a dir that will be discovered1118""",1119u"""1120Cleaned up links from writing plugins guide to plugins in generated docs.1121""",1122u"""1123Fixed #173 Fix a 2.3 incompatibility.1124""",1125u"""1126Made node.result into package1127""",1128u"""1129Added better comments to testid plugin.1130""",1131u"""1132Add the tests for issue #155 I intended to commit with r4561133""",1134u"""1135Added preliminary api sketch/doctest1136""",1137u"""1138Added highlighted source to builtin plugin doc files1139""",1140u"""1141Fixed #1551142""",1143u"""1144Cut branch for work on reporting sprint at pycon (3/16 4pm-7pm in open space)1145""",1146u"""1147Re-fixed profile/plugin tests for jython1148""",1149u"""1150Added basic plugin use and 0.9 plugin compat info to usage.1151""",1152u"""1153Fixed #159. Correct bad ErrorClass exception detail1154""",1155u"""1156Possibly fixed twisted error under jython1157""",1158u"""1159Reworked fix for issue #72 to avoid changes to the plugin interfaces for formatError and formatFailure.1160""",1161u"""1162Fixed #154. Use correct stack frame in doctest pdb support monkeypatch1163""",1164u"""1165Possibly fixed hotshot import error under jython1166""",1167u"""1168Fixed issue #72. Bumped version to 0.10.0b1.1169""",1170u"""1171Add the tests for #142 I intended to commit with r4391172""",1173u"""1174Applied patch from issue #1601175""",1176u"""1177Made minor cosmetic changes. Added --logging-clear-handlers option to logcapture plugin. Added a bit more documentation to logcapture module. Changed plugin to disable itself if a logging config file is in use.1178""",1179u"""1180fixing my embarrassing mistake of overwriting the name variable. And renaming TC_Custom to TestMetaclassed. makes more sense1181""",1182u"""1183Fixed #71. Updated CHANGELOG with recent fixes.1184""",1185u"""1186Fixed #142. For ignored (false .isfailure) errorclass errors, like SkipTest,1187""",1188u"""1189Cut branch to work on jython compatibility1190""",1191u"""1192minor code changes and cleanup1193""",1194u"""1195patched isclass() so that it detected classes with custom types (__metaclass__). Added several tests for this in various places. However, there is still something wrong and I can't reproduce it in a test yet. I can reproduce it with a short test module. I will try that next. This is a start1196""",1197u"""1198Fixed issue #651199""",1200u"""1201merged Ticket-153 branch into trunk, -r433:HEAD . This fixes bugs in metaclass support when nose is discovering tests.1202""",1203u"""1204changed default logformat1205""",1206u"""1207"creating branch Ticket-153"1208""",1209u"""1210Fixed issue #681211""",1212u"""1213implemented --logging-format option1214""",1215u"""1216Clarify comment1217""",1218u"""1219Removed stray debug print from nose.commands1220""",1221u"""1222first working version (still rough)1223""",1224u"""1225Handle attribute errors raised by doctest when a module sets __test__ to something other than a dict.1226""",1227u"""1228Updated changelog1229""",1230u"""1231typo fixed1232""",1233u"""1234Forgot to add new file1235""",1236u"""1237For function and method test cases, if the test function or method has the attribute description, use that as the test description. Most useful for generators: set the description attribute on the yielded function.1238""",1239u"""1240spelling typo fixed1241""",1242u"""1243Updated changelog1244""",1245u"""1246whoops, forgot the alias to self.suiteClass1247""",1248u"""1249initial version from rev 4181250""",1251u"""1252Fixed #152: applied patch1253""",1254u"""1255created functional tests out of the proof of concept suites for lazy importing1256""",1257u"""1258Regenerated docs1259""",1260u"""1261Bumped version post-release and fixed some bugs in mkrelease.1262""",1263u"""1264got AST loading from a test suite as module working for a very limited scenario1265""",1266u"""1267Release branch for 0.10.11268""",1269u"""1270Added google analytics code to templates1271""",1272u"""1273as described in last commit, here is the actual test suite used for a proof of concept1274""",1275u"""1276Updated copyright date range1277""",1278u"""1279Better svnroot finding1280""",1281u"""1282broke a ton of stuff but got AST working for a very very basic test suite in my tmp dir: a single directory named "test" (not a module) with two files: test_muhah.py and test_foos.py. the former will raise an import error if imported and contains no tests, the latter contains one test which passes1283""",1284u"""1285Updated NEWS and docs for release.1286""",1287u"""1288Added missing doc, fixed paths in setup and mkwiki.1289""",1290u"""1291a proof of concept ast visitor1292""",1293u"""1294MERGED 0.10.0-stable 378:411 to trunk in preparation for 0.10.1 release.1295""",1296u"""1297Updated documentation in preparation for release.1298""",1299u"""1300creating branch ast_discovery1301""",1302u"""1303CSS fix for issue #139.1304""",1305u"""1306Added test for entrypoint name fix1307""",1308u"""1309Bumped trunk version number to 0.111310""",1311u"""1312Fixed issue #63. Bumped version to 0.10.0a2 in preparation for release.1313""",1314u"""1315Merged 0.10.0-stable [308]:[378] into trunk1316""",1317u"""1318Fixed plugin loading bugs.1319""",1320u"""1321Merged 0.10.0-stable [282]:[308] into trunk1322""",1323u"""1324Fixed added is_generator to nose.util (alias for isgenerator)1325""",1326u"""1327Merged 0.10.0-stable [266]:[282] into trunk.1328""",1329u"""1330Release branch for 0.10.0a11331""",1332u"""1333Added missing doc file, fixed some typos1334""",1335u"""1336More tweaks1337""",1338u"""1339More release script tweaking1340""",1341u"""1342Working on fixes to release script1343""",1344u"""1345Fixed typo1346""",1347u"""1348Doc updates; sort menu sections.1349""",1350u"""1351Preparing for 0.10a1 release1352""",1353u"""1354Updated man page1355""",1356u"""1357Implemented loadTestsFromTestCase hook for plugins, with test.1358""",1359u"""1360Added regression test for issue #31361""",1362u"""1363Pass kw args from runmodule to TestProgram1364""",1365u"""1366Removed testgears reference from site index. Added api doc index.1367""",1368u"""1369Added icons and cleaned up some formatting.1370""",1371u"""1372Divided menu into sections1373""",1374u"""1375More work on doc generation: added module attributes1376""",1377u"""1378More work on doc generation1379""",1380u"""1381More work on doc generation1382""",1383u"""1384Hide DeprecationWarning for multiple -w args in test of multiple -w args1385""",1386u"""1387Further work on documentation generation.1388""",1389u"""1390Changed loader to more defensive when plugins try to load tests.1391""",1392u"""1393Added menu links to generated docs1394""",1395u"""1396More plugin doc updates1397""",1398u"""1399Improved formatting of plugin interface and builtin plugin docs1400""",1401u"""1402Started work on generating html docs for builtin plugins1403""",1404u"""1405Updated NEWS and CHANGELOG. Further work (still in progress) on generating plugin api docs.1406""",1407u"""1408Working on doc writers for plugin guide and api docs1409""",1410u"""1411Fixed #48 (verbose/verbosity doc issue)1412""",1413u"""1414Started work on doc links and index organization1415""",1416u"""1417Fixed mkindex.py script. Started revising index documentation.1418""",1419u"""1420Added additional twisted integration tests. Fixed bug in twistedtools handling of reactors that caused twisted.trial tests run after twistedtools tests to hang or otherwise fail to report any outcome.1421""",1422u"""1423Changed exit argument to TestProgram to exit from exit_. Added failing error classes to test run summary.1424""",1425u"""1426Restored --testmatch option used to set test match regex. Added -p, --plugins option that displays list of available plugins.1427""",1428u"""1429Restored correct default behavior of main() (exits), run() (does not exit, returns success)1430""",1431u"""1432Copied branches/0.10-dev to trunk. Trunk is now on 0.10.1433""",1434u"""1435Updated setup.py to work without setuptools, if setuptools is not available1436""",1437u"""1438Finished docstring sanity checks1439""",1440u"""1441Updated docs in plugins.attrib and plugins.base1442""",1443u"""1444Corrected some orphan imports found by pyflakes1445""",1446u"""1447Added nosetests script under bin for non-setuptools use.1448""",1449u"""1450Updated add_path so that it adds lib and src dirs in the parent path to sys.path also. Added functional test for lib/ src/ tests/ package layout.1451""",1452u"""1453Updated docs in nose.plugins (top level of package only)1454""",1455u"""1456Added functional test for testid/doctest integration when tests are from non-module files.1457""",1458u"""1459Doc updates: all but plugins1460""",1461u"""1462Applied missing changeset from trunk with fix and tests for multi-line docstrings near introspected asserts1463""",1464u"""1465Restored lib-first sorting to loadTestFromDir -- needs tests.1466""",1467u"""1468Fixed bugs in doctest loading from non-module files. Added functional test.1469""",1470u"""1471Added shortDescription() to suite class, since it can push errors into result. Marked TODO items that need to be done before moving branch to trunk.1472""",1473u"""1474Added camelCase variants for context fixture function names1475""",1476u"""1477Doc updates (through nose.core)1478""",1479u"""1480Reworked plugin manager and proxy to be more efficient1481""",1482u"""1483Removed log.debug calls in some inner loops (optimization)1484""",1485u"""1486Updated TODO, made another note of docs that need fixing.1487""",1488u"""1489Changed getTestCaseNames to include runTest in test case case names if no other name selected -- 2.3 compat1490""",1491u"""1492Added python 2.4 doctest as nose.ext.dtcompat to enable better doctest support for python 2.31493""",1494u"""1495Fixed 2.3 compat error in suites.1496""",1497u"""1498Added --tests argument and deprecation warning for multiple use of -w1499""",1500u"""1501Most of new -w behavior1502""",1503u"""1504Removed __del__ from capture plugin: was causing odd side-effects when doctest enabled(?). Added set_trace convenience method to tools. Fixed various other small bugs.1505""",1506u"""1507Implemented loadTestsFromNames hook in isolate plugin.1508""",1509u"""1510Added first isolate plugin functional tests (one failing)1511""",1512u"""1513Added support files for isolate plugin functional tests1514""",1515u"""1516Some work on 2.3 compat -- still much to do1517""",1518u"""1519Added plugin hooks that isolate plugin will need1520""",1521u"""1522Fixed failing unit test imported from trunk1523""",1524u"""1525Copied files missing from trunk merge due to lost history from hosting move1526""",1527u"""1528Fixed tests failing after trunk merge1529""",1530u"""1531MERGE trunk r10:r196 into 0.10-dev branch: some tests now fail1532""",1533u"""1534Updated TODO and some docs/comments1535""",1536u"""1537Modifed doctests plugin to use local subclasses of DocTestCase and DocFileCase that add address() and fix name attribute rather than wrapping. Removed TestWrapper from nose.case. Made builtin plugin loading slightly less manual and more robust.1538""",1539u"""1540Moved test wrapper class from doctest to nose.case, most test-loading plugins will need it.1541""",1542u"""1543Work on integrating doctest and testid plugins; doctest still needs some work to provide correct information to rest of system when individual tests are loaded.1544""",1545u"""1546Fixed bugs in address() method for test generators. Fixed multiple ids output for generators in testid plugin. Updated TODO.1547""",1548u"""1549Implemented basics of testid plugin. Still needs tests for doctests, and more tests for generator tests1550""",1551u"""1552Started work on testid plugin1553""",1554u"""1555Implemented loading from file.py:callable name. Removed debug log features from plugintest -- too complex to implement for this release.1556""",1557u"""1558Updated TODO with issues relating to enabling debug logging within plugintester test runs, fixed python 2.5 test failure in nose.plugins.errorclass1559""",1560u"""1561Started suite of tests of individual plugin api calls. Made plugin api call tracking test actually test something.1562""",1563u"""1564Updated TODO. Added prepareTestCase plugin hook.1565""",1566u"""1567Updated TODO1568""",1569u"""1570Fixed bug in 0.9 addSuccess plugin call adaptation.1571""",1572u"""1573Work on filling in gaps in plugin api, compat tests for 0.9-api plugins.1574""",1575u"""1576Moved logging config to Config.configureLogging, added option to configure logging via logging config file.1577""",1578u"""1579Fixed nose.core.collector, restored python setup.py test functionality1580""",1581u"""1582Fixed commands module. Started work on making setuptools optional for install -- setup most likely is broken.1583""",1584u"""1585Replaced inspect.isclass with less-permissive isclass.1586""",1587u"""1588Additional function tests for mixedSuites suite/loader interaction. Cleaned up debug prints.1589""",1590u"""1591Work in progress on loadTestsFromNames/context suite interaction1592""",1593u"""1594Added ContextList helper class. Revised naming -- s/parent/context/ in context suites, cases and loader.1595""",1596u"""1597Work on context suite/factory/loader to make them more compatible and able to run loadTestsFromNames efficiently (nowhere near done)1598""",1599u"""1600About to being removed parent arg from context suite factory1601""",1602u"""1603Started work on fixture changes needed to support effecient loadTestsFromNames1604""",1605u"""1606Additional notes on efficiency vs correct fixture context1607""",1608u"""1609Notes and work on fixing design of context fixtures, w/r/t loadTestsFromNames1610""",1611u"""1612Added a few more plugin hooks to loader1613""",1614u"""1615Implemented assert inspection as a plugin.1616""",1617u"""1618Added array-attribute tests1619""",1620u"""1621Use selector for test case loading, too, unless configured otherwise. More attrib plugin tests.1622""",1623u"""1624Added functional test for test cases, implemented testName and describeTest plugin hooks.1625""",1626u"""1627CamelCased Importer methods for consistency1628""",1629u"""1630Started attrib plugin functional test suite. Fixed bugs in attrib plugin.1631""",1632u"""1633Updated TODO. Fixed bugs in unit and functional tests. Changed some attibute names in plugin tester to be more appropriate.1634""",1635u"""1636Fixed interaction between doctest test and importer test. Changed program tests to use canned config so they do not pick up settings from config files. Removed no longer appropriate unit tests.1637""",1638u"""1639Added basic functional test for doctest plugin using plugintester1640""",1641u"""1642Removed a stray import added by previous patch1643""",1644u"""1645Added plugintest, adapted from Kumar McMillan's patch in #35.1646""",1647u"""1648Added support for loading tests from plugins. Added discovered flag to loader so it can distinguish discovered modules from requested modules. Added __test__ flag support to selector for marking modules, classes, methods or function as tests or not tests.1649""",1650u"""1651Fixed option handling in builtin plugins. Removed missed tests builtin, no longer needed1652""",1653u"""1654Updated TODO. Added beforeTest and afterTest to plugin interface definition. Fixed bug in capture plugin that caused capture to stop after first error.1655""",1656u"""1657Implemented Test.address method. Fixed failing test_address tests1658""",1659u"""1660Fixed some failing imports in tests1661""",1662u"""1663Make capture store a stack of stdout patches so it may be called repeatedly.1664""",1665u"""1666Implemented config file support (#18) based on patch from Antoine Pitrou.1667""",1668u"""1669Fixed some unit tests1670""",1671u"""1672Removed deprecated tests and modules1673""",1674u"""1675Restored stop on error functionality1676""",1677u"""1678Removed deprecated code from selector, integrated selector into loader1679""",1680u"""1681Added some doctests to errorclass1682""",1683u"""1684Fixed loader and result bugs.1685""",1686u"""1687Abstracted ErrorClassPlugin and helpers from SkipTest plugin. Implemented DeprecatedTest plugin1688""",1689u"""1690Added score attribute to plugins and made them sorted by score. Fixed failing skip/pdb interaction test1691""",1692u"""1693Added failing test for skip/pdb interaction1694""",1695u"""1696Fixed a 2.3 compat issue in suite, added failing functional test for id plugin1697""",1698u"""1699More work on moving output capture to a plugin1700""",1701u"""1702Sketched legacy plugin manager/proxy that will be used to support 0.9 plugins in 0.101703""",1704u"""1705Updated pdb plugin to actively reset sys.stdout to sys.__stdout__ before running pdb. Added notes for test name() function that must return round-trip name for a test1706""",1707u"""1708Started work on output capture plugin1709""",1710u"""1711Added TODO and PLUGIN_API_CHANGES.txt documents. Filled in pdb plugin. Fixed some broken tests.1712""",1713u"""1714Started work on pdb-errors/pdb-fails plugin1715""",1716u"""1717Moved some functionality from skip plugin to nose.result, anticipating deprecated test plugin and erroClass plugin base class1718""",1719u"""1720Added config methods to skip plugin, fixed patching logic, added 3rd term to errorClasses to allow registering whether a given error should cause the run to not be successful.1721""",1722u"""1723Further work on self-hosting, skip plugin1724""",1725u"""1726Started work on converting skip/deprecated test handling to plugins1727""",1728u"""1729Approaching self-hosting: 0.10 can load and run its own functional test suite.1730""",1731u"""1732Added start of plugins integration test, additional failing test to config unit test1733""",1734u"""1735Work on integrating plugin calls, notes on result/proxy system.1736""",1737u"""1738Cleaned up some tests, added real plugin managers1739""",1740u"""1741Added a functional test for testprogram that loads some tests1742""",1743u"""1744Fixed bugs in context handling and loader1745""",1746u"""1747Improved importer behavior with dotted names.1748""",1749u"""1750Work in progress on moving more of the context functionality into the context suite/factory1751""",1752u"""1753Work on fixing bugs in context fixture handling when test names are specified1754""",1755u"""1756Began work on functional tests from TestProgram1757""",1758u"""1759Work on integration of resultProxy into suite/case, unit and functional tests, continued removal of context bits1760""",1761u"""1762Fixed case and suite unittests (post context removal)1763""",1764u"""1765Fixing tests and such for removal of context object1766""",1767u"""1768Extremely broken: half way through removal of context class.1769""",1770u"""1771Moved trunk to branches/0.9 in anticipation of copying 0.10-dev to trunk1772""",1773u"""1774Moved trunk to branches/0.9 in anticipation of copying 0.10-dev to trunk1775""",1776u"""1777Release branch for 0.9.31778""",1779u"""1780Further work on integrating result proxying. Just about to start removing the context object.1781""",1782u"""1783Small edit to NEWS1784""",1785u"""1786Work on result proxying and new plugin manager.1787""",1788u"""1789Applied patch in #52 to fix bug in doctests/exclude interaction.1790""",1791u"""1792Missed test support files1793""",1794u"""1795Added config file support. Thanks to Antoine Pitrou.1796""",1797u"""1798Fleshed out loader/fixture functional test1799""",1800u"""1801Final updates prior to 0.9.3 release1802""",1803u"""1804Work on suite fixtures/loader function test.1805""",1806u"""1807Fixed 0-byte temp file leak with patch from Antoine Pitrou (#2)1808""",1809u"""1810Current context implementation is flawed: it has to do a *lot* of extra work when a parent-level setup fails. Beginning new, suite-based fixture implementation.1811""",1812u"""1813Catch "has no tests" value errors in all python versions -- 2.4 can raise them too.1814""",1815u"""1816Updated test_loader.py to use a mock Importer1817""",1818u"""1819Fixed doctest error handling in 2.41820""",1821u"""1822Work on supporting packages in importer.1823""",1824u"""1825Added test using twisted test case to check compatibility1826""",1827u"""1828Work on loader and importer integration.1829""",1830u"""1831Included with_setup in nose.tools.__all__1832""",1833u"""1834Started work on loader functional tests, revising importer interface1835""",1836u"""1837Added support files for importer functional test and tried (again) to ignore .pyc files1838""",1839u"""1840* Bumped version to 0.9.31841""",1842u"""1843Work on importer, plus propset to ignore .pyc files1844""",1845u"""1846Only remove the profile stats temp file when no profile stats file was specified.1847""",1848u"""1849Added functional tests dir, started work on revised importer.1850""",1851u"""1852Work on better use of temp file in profiler plugin1853""",1854u"""1855Work on basic result proxy tests and implementation.1856""",1857u"""1858Possible fix for errors with twisted.unittest.TestCase tests1859""",1860u"""1861Release branch for 0.9.21862""",1863u"""1864Started work on new implementation of result proxying/output capture1865""",1866u"""1867More fixes to mkrelease script1868""",1869u"""1870Added __str__, id() and shortDescription() to MethodTestCase1871""",1872u"""1873More fixes to mkrelease script1874""",1875u"""1876Implemented run() in nose.case.Test to avoid duplicate result calls.1877""",1878u"""1879Fixed paths in mkrelease script1880""",1881u"""1882Moved nose.fixture to nose.context and renamed Context to FixtureContext. Began implementing result proxying.1883""",1884u"""1885Updated docs and ez_setup for 0.9.2 release1886""",1887u"""1888Implemented first draft support for class-level fixtures.1889""",1890u"""1891Fixed bugs in 2.3 compatibility1892""",1893u"""1894Fixed issues resulting from file move. Implemented instance fixtures in MethodTestCase. Renamed some parameters.1895""",1896u"""1897Fixed bugs in make_decorator that hid tests from selector in python 2.3. Made test_twisted compatible with 2.3 by changing decorator syntax to direct calls.1898""",1899u"""1900Moved in-progress loader and suite and their tests into place.1901""",1902u"""1903Wiki and doc updates for 0.9.21904""",1905u"""1906Removed old versions of suite, loader and their tests.1907""",1908u"""1909Updated NEWS and CHANGELOG for 0.9.2 release1910""",1911u"""1912Renamed some args and funcs in test case classes. Added support for generator methods.1913""",1914u"""1915Improved nosetests man page formatting.1916""",1917u"""1918Added failing tests for features under development (generator methods, class-level fixture context). Fleshed out MethodTestCase a bit.1919""",1920u"""1921Added nosetests.1 man page.1922""",1923u"""1924Added support for generator functions to new loader. Assorted code cleanups.1925""",1926u"""1927Revised cheeseshop long description1928""",1929u"""1930Added some implementation notes, started work on generator support1931""",1932u"""1933Changed INFO message issued when working directory is inside of a package (issue #15)1934""",1935u"""1936Misc notes and reformattings1937""",1938u"""1939Fixed issue #251940""",1941u"""1942Renamed poorly named method1943""",1944u"""1945More fixes to mkwiki1946""",1947u"""1948Refactored TestLoader to tighten it up a bit. Made loader tests a bit more comprehensive.1949""",1950u"""1951Fixed mkwiki ref issues1952""",1953u"""1954Further work on filling out loader functionality. Fixed bugs in util functions.1955""",1956u"""1957Work on expanding and correcting documentation.1958""",1959u"""1960Renamed some poorly-named functions. Implemented rudimentary test function support in loader. Added context suite tests and fixed bugs in nested context suites.1961""",1962u"""1963Fixed issue #6: method generators using inline functions no longer raises an exception.1964""",1965u"""1966Updated README with warning and description of release goals1967""",1968u"""1969Applied patch to fix handling of some options from setup.cfg from issue #131970""",1971u"""1972Work on integrating the fixture context into the test loader1973""",1974u"""1975Applied patch for 2.2 compat from issue #231976""",1977u"""1978Work on new loader and tests. Started adding doctests to nose.util.1979""",1980u"""1981Applied patch from issue #1, with minor tweaks and a unit test.1982""",1983u"""1984Moved and renamed fixture.Case to case.Test, began work on new suite and loader1985""",1986u"""1987Updated svn:ignore, docs, mkwiki1988""",1989u"""1990Moved fixtr and test_fixtr into proper locations1991""",1992u"""1993Moving rst2wiki to mkwiki1994""",1995u"""1996Removed some completed FIXMEs1997""",1998u"""1999More work on rst2wiki and doc updates2000""",2001u"""2002Fixture context passes mod.submod test2003""",2004u"""2005Work in progress on new rst->wiki formatter2006""",2007u"""2008Added failing tests for handling dotted modules in fixture context (work)2009""",2010u"""2011Updated index page for project home with new project hosting details2012""",2013u"""2014Started work on experimental fixture context2015""",2016u"""2017Added tickets from old site (rrss feed)2018""",2019u"""2020Consolidated notes and NOTES into NOTES2021""",2022u"""2023Added tickets from old site (csv format)2024""",2025u"""2026[0.10-dev] Imported last revision from python-hosting to start 0.10-dev branch2027""",2028u"""2029Imported trunk last revision from python hosting.2030""",...
test_diff.py
Source:test_diff.py
1import json2import os3import pickle4from nose.tools import eq_5from ....dependencies import solve6from ..revision_oriented import revision7pwd = os.path.dirname(os.path.realpath(__file__))8ALAN_TOURING = json.load(open(os.path.join(pwd, "alan_turing.json")))9ALAN_TOURING_OLD = json.load(open(os.path.join(pwd, "alan_turing.old.json")))10revision_item_doc = revision.datasources.item_doc11parent_item_doc = revision.parent.datasources.item_doc12diff = revision.diff13def test_sitelinks_diff():14 cache = {revision_item_doc: ALAN_TOURING,15 parent_item_doc: ALAN_TOURING_OLD}16 sitelinks_diff = solve(diff.datasources.sitelinks_diff, cache=cache)17 eq_(sitelinks_diff.added,18 {'alswiki', 'fowiki', 'itwikiquote', 'commonswiki', 'mgwiki',19 'cywikiquote', 'ruwikiquote', 'kkwiki', 'ttwiki', 'cawikiquote',20 'eswikiquote', 'cewiki', 'cowiki', 'pawiki', 'cswikiquote',21 'hewikiquote', 'newwiki', 'uzwiki', 'zhwikiquote', 'bawiki',22 'furwiki', 'scowiki', 'dewikiquote', 'frwikiquote', 'plwikiquote',23 'enwikiquote'})24 eq_(sitelinks_diff.removed, set())25 eq_(sitelinks_diff.intersection,26 {'htwiki', 'mtwiki', 'swwiki', 'mkwiki', 'warwiki', 'anwiki', 'rowiki',27 'bgwiki', 'bnwiki', 'orwiki', 'idwiki', 'arwiki', 'skwiki', 'ruewiki',28 'tawiki', 'nnwiki', 'pnbwiki', 'guwiki', 'dewiki', 'cswiki',29 'ilowiki', 'kawiki', 'lvwiki', 'afwiki', 'jvwiki', 'zh_yuewiki',30 'tgwiki', 'hrwiki', 'brwiki', 'iswiki', 'ruwiki', 'dawiki', 'eswiki',31 'ltwiki', 'fawiki', 'bewiki', 'glwiki', 'iowiki', 'vowiki', 'yiwiki',32 'yowiki', 'plwiki', 'be_x_oldwiki', 'mlwiki', 'mswiki', 'astwiki',33 'hifwiki', 'urwiki', 'hewiki', 'aswiki', 'ocwiki', 'sawiki', 'cawiki',34 'tewiki', 'hiwiki', 'shwiki', 'pmswiki', 'trwiki', 'zh_min_nanwiki',35 'tlwiki', 'knwiki', 'jawiki', 'arzwiki', 'cywiki', 'lijwiki',36 'ptwiki', 'zhwiki', 'viwiki', 'mwlwiki', 'nlwiki', 'kowiki',37 'ganwiki', 'lawiki', 'simplewiki', 'bswiki', 'etwiki', 'slwiki',38 'huwiki', 'hywiki', 'sqwiki', 'srwiki', 'liwiki', 'lbwiki', 'fywiki',39 'mnwiki', 'fiwiki', 'lmowiki', 'jbowiki', 'thwiki', 'sahwiki',40 'euwiki', 'gawiki', 'azwiki', 'elwiki', 'kuwiki', 'ukwiki',41 'bat_smgwiki', 'pamwiki', 'mrwiki', 'enwiki', 'ckbwiki', 'frwiki',42 'eowiki', 'svwiki', 'gdwiki', 'scnwiki', 'itwiki', 'nowiki'})43 eq_(sitelinks_diff.changed, {'skwiki', 'sahwiki'})44 eq_(sitelinks_diff.unchanged,45 {'warwiki', 'aswiki', 'cywiki', 'lvwiki', 'sawiki', 'zh_yuewiki',46 'tewiki', 'pnbwiki', 'idwiki', 'mlwiki', 'anwiki', 'pmswiki',47 'kawiki', 'ptwiki', 'iowiki', 'ltwiki', 'bat_smgwiki', 'cswiki',48 'swwiki', 'rowiki', 'mswiki', 'etwiki', 'jvwiki', 'dawiki',49 'hifwiki', 'euwiki', 'simplewiki', 'htwiki', 'srwiki', 'huwiki',50 'bswiki', 'ilowiki', 'brwiki', 'hrwiki', 'eswiki', 'yiwiki', 'bnwiki',51 'glwiki', 'zhwiki', 'hiwiki', 'tawiki', 'eowiki', 'kowiki', 'yowiki',52 'jawiki', 'scnwiki', 'slwiki', 'astwiki', 'lijwiki', 'nnwiki',53 'svwiki', 'ruwiki', 'tlwiki', 'bgwiki', 'pamwiki', 'sqwiki', 'tgwiki',54 'gdwiki', 'fiwiki', 'mwlwiki', 'mnwiki', 'lmowiki', 'ukwiki',55 'arwiki', 'hewiki', 'enwiki', 'orwiki', 'lbwiki', 'thwiki', 'fywiki',56 'knwiki', 'elwiki', 'frwiki', 'shwiki', 'itwiki', 'azwiki',57 'zh_min_nanwiki', 'gawiki', 'liwiki', 'iswiki', 'trwiki', 'cawiki',58 'nlwiki', 'be_x_oldwiki', 'kuwiki', 'lawiki', 'bewiki', 'guwiki',59 'urwiki', 'nowiki', 'fawiki', 'jbowiki', 'ruewiki', 'afwiki',60 'arzwiki', 'ganwiki', 'ckbwiki', 'ocwiki', 'plwiki', 'dewiki',61 'viwiki', 'hywiki', 'mkwiki', 'mrwiki', 'mtwiki', 'vowiki'})62 eq_(pickle.loads(pickle.dumps(diff.datasources.sitelinks_diff)),63 diff.datasources.sitelinks_diff)64def test_labels_diff():65 cache = {revision_item_doc: ALAN_TOURING,66 parent_item_doc: ALAN_TOURING_OLD}67 labels_diff = solve(diff.datasources.labels_diff, cache=cache)68 eq_(labels_diff.added,69 {'tt', 'fo', 'pa', 'nan', 'sgs', 'mg', 'zh-cn', 'ba', 'fur', 'sco',70 'co', 'gsw', 'uz', 'kk', 'zh-hans', 'new', 'ce', 'de-ch'})71 eq_(labels_diff.removed,72 {'simple', 'zh-yue', 'bat-smg', 'be-x-old', 'zh-min-nan', 'no'})73 eq_(labels_diff.intersection,74 {'jv', 'gl', 'te', 'war', 'pt', 'de', 'gd', 'sq', 'lv', 'hif', 'hy',75 'hr', 'rue', 'pnb', 'ca', 'ka', 'nl', 'sr', 'gan', 'ur', 'vi', 'bg',76 'scn', 'th', 'ast', 'az', 'tl', 'mr', 'af', 'zh', 'ko', 'be', 'ja',77 'ml', 'ilo', 'oc', 'cs', 'lb', 'yue', 'fi', 'sw', 'pl', 'es', 'eo',78 'arz', 'nb', 'nn', 'ru', 'tr', 'mk', 'sa', 'en-gb', 'mn', 'br',79 'sah', 'ro', 'yo', 'is', 'el', 'jbo', 'he', 'en', 'hi', 'bs', 'id',80 'gu', 'sv', 'lmo', 'pt-br', 'an', 'kn', 'ar', 'it', 'mt', 'tg', 'io',81 'ms', 'sh', 'eu', 'or', 'li', 'pam', 'pms', 'la', 'mwl', 'lij', 'da',82 'vo', 'fr', 'uk', 'fy', 'lt', 'bn', 'et', 'ku', 'ht', 'yi', 'ckb',83 'sk', 'fa', 'hu', 'as', 'be-tarask', 'ta', 'ga', 'sl', 'cy', 'en-ca'})84 eq_(labels_diff.changed, {'ru', 'eo'})85 eq_(labels_diff.unchanged,86 {'ml', 'nn', 'hif', 'hr', 'hu', 'ar', 'ka', 'ko', 'vi', 'he', 'jbo',87 'sah', 'as', 'bs', 'ht', 'pam', 'scn', 'tr', 'tg', 'mr', 'mwl', 'nl',88 'io', 'rue', 'es', 'el', 'pnb', 'sq', 'nb', 'sk', 'ja', 'mt', 'de',89 'arz', 'it', 'sw', 'kn', 'ku', 'sa', 'or', 'sr', 'pt', 'zh', 'af',90 'cy', 'th', 'pt-br', 'hi', 'pms', 'jv', 'ta', 'fa', 'sl', 'fr', 'yo',91 'lij', 'li', 'en-gb', 'sv', 'hy', 'bg', 'lb', 'en', 'fi', 'lmo',92 'az', 'da', 'te', 'eu', 'ast', 'ms', 'gan', 'ca', 'la', 'ro', 'uk',93 'mn', 'mk', 'lt', 'vo', 'is', 'et', 'br', 'fy', 'yue', 'be', 'yi',94 'ga', 'bn', 'sh', 'gl', 'cs', 'ckb', 'ur', 'tl', 'pl', 'lv', 'id',95 'gd', 'war', 'gu', 'an', 'oc', 'en-ca', 'be-tarask', 'ilo'})96 eq_(pickle.loads(pickle.dumps(diff.datasources.labels_diff)),97 diff.datasources.labels_diff)98def test_aliases_diff():99 cache = {revision_item_doc: ALAN_TOURING,100 parent_item_doc: ALAN_TOURING_OLD}101 aliases_diff = solve(diff.datasources.aliases_diff, cache=cache)102 eq_(aliases_diff.added,103 {'ko', 'ru'})104 eq_(aliases_diff.removed, set())105 eq_(aliases_diff.intersection,106 {'ja', 'fr', 'de', 'be-tarask', 'jbo', 'en', 'it'})107 eq_(aliases_diff.changed, set())108 eq_(aliases_diff.unchanged,109 {'en', 'be-tarask', 'de', 'jbo', 'it', 'fr', 'ja'})110 eq_(pickle.loads(pickle.dumps(diff.datasources.aliases_diff)),111 diff.datasources.aliases_diff)112def test_descriptions_diff():113 cache = {revision_item_doc: ALAN_TOURING,114 parent_item_doc: ALAN_TOURING_OLD}115 descriptions_diff = solve(diff.datasources.descriptions_diff, cache=cache)116 eq_(descriptions_diff.added,117 {'da', 'sk', 'as', 'zh-cn', 'pl', 'ru', 'nl', 'zh', 'gl', 'nn', 'pam',118 'nb', 'sv', 'ko', 'zh-hans'})119 eq_(descriptions_diff.removed, set())120 eq_(descriptions_diff.intersection,121 {'en', 'it', 'fr', 'es', 'ilo', 'fa', 'de'})122 eq_(descriptions_diff.changed, {'fa'})123 eq_(descriptions_diff.unchanged, {'fr', 'it', 'es', 'de', 'en', 'ilo'})124 eq_(pickle.loads(pickle.dumps(diff.datasources.descriptions_diff)),125 diff.datasources.descriptions_diff)126def test_properties_diff():127 cache = {revision_item_doc: ALAN_TOURING,128 parent_item_doc: ALAN_TOURING_OLD}129 properties_diff = solve(diff.datasources.properties_diff, cache=cache)130 eq_(properties_diff.added,131 {'P31', 'P1741', 'P950', 'P935', 'P27', 'P1296', 'P1415', 'P1207',132 'P549', 'P512', 'P1343', 'P906', 'P1816', 'P735', 'P25', 'P1417',133 'P1412', 'P691', 'P949', 'P800', 'P1273', 'P1196', 'P1819', 'P646',134 'P140', 'P1563', 'P1430', 'P345', 'P1263', 'P1006', 'P166', 'P2021',135 'P910', 'P108', 'P22'})136 eq_(properties_diff.removed, {'P509', 'P107'})137 eq_(properties_diff.intersection,138 {'P69', 'P268', 'P213', 'P106', 'P20', 'P19', 'P214', 'P269', 'P91',139 'P570', 'P18', 'P185', 'P227', 'P101', 'P463', 'P535', 'P373', 'P184',140 'P244', 'P21', 'P349', 'P569'})141 eq_(properties_diff.changed,142 {'P19', 'P570', 'P91', 'P569', 'P20', 'P227', 'P101', 'P69', 'P21',143 'P106'})144 eq_(properties_diff.unchanged,145 {'P244', 'P269', 'P268', 'P535', 'P18', 'P373', 'P185', 'P213', 'P463',146 'P349', 'P184', 'P214'})147 eq_(pickle.loads(pickle.dumps(diff.datasources.properties_diff)),148 diff.datasources.properties_diff)149 eq_(solve(diff.properties_added, cache=cache), 35)150 eq_(solve(diff.properties_removed, cache=cache), 2)151 eq_(solve(diff.properties_changed, cache=cache), 10)152 eq_(pickle.loads(pickle.dumps(diff.properties_added)),153 diff.properties_added)154 eq_(pickle.loads(pickle.dumps(diff.properties_removed)),155 diff.properties_removed)156 eq_(pickle.loads(pickle.dumps(diff.properties_changed)),157 diff.properties_changed)158def test_claims_diff():159 cache = {revision_item_doc: ALAN_TOURING,160 parent_item_doc: ALAN_TOURING_OLD}161 eq_({c.id for c in solve(diff.datasources.claims_added, cache=cache)},162 {'P1430', 'P1006', 'P691', 'P512', 'P1816', 'P735', 'P646', 'P1412',163 'P1196', 'P2021', 'P950', 'P1273', 'P31', 'P1563', 'P906', 'P949',164 'P106', 'P1417', 'P22', 'P1263', 'P549', 'P19', 'P1207', 'P1415',165 'P345', 'P1741', 'P800', 'P1296', 'P910', 'P166', 'P140', 'P108',166 'P1819', 'P935', 'P25', 'P69', 'P27', 'P1343'})167 eq_({c.id for c in solve(diff.datasources.claims_removed, cache=cache)},168 {'P107', 'P509'})169 eq_({c.id for c, _ in solve(diff.datasources.claims_changed, cache=cache)},170 {'P21', 'P570', 'P101', 'P19', 'P106', 'P91', 'P20', 'P69', 'P569',171 'P227'})172 eq_(solve(diff.claims_added, cache=cache), 46)173 eq_(solve(diff.claims_removed, cache=cache), 2)174 eq_(solve(diff.claims_changed, cache=cache), 10)175 eq_(pickle.loads(pickle.dumps(diff.claims_added)),176 diff.claims_added)177 eq_(pickle.loads(pickle.dumps(diff.claims_removed)),178 diff.claims_removed)179 eq_(pickle.loads(pickle.dumps(diff.claims_changed)),180 diff.claims_changed)181def test_sources_diff():182 cache = {revision_item_doc: ALAN_TOURING,183 parent_item_doc: ALAN_TOURING_OLD}184 eq_({c.id for c in solve(diff.datasources.sources_added, cache=cache)},185 {'P813', 'P248', 'P854', 'P143', 'P345'})186 eq_({c.id for c in solve(diff.datasources.sources_removed, cache=cache)},187 {'P143'})188 eq_(solve(diff.sources_added, cache=cache), 26)189 eq_(solve(diff.sources_removed, cache=cache), 1)190 eq_(pickle.loads(pickle.dumps(diff.sources_added)),191 diff.sources_added)192 eq_(pickle.loads(pickle.dumps(diff.sources_removed)),193 diff.sources_removed)194def test_qualifiers_diff():195 # TODO: Ladsgroup, this test seems wrong196 cache = {revision_item_doc: ALAN_TOURING,197 parent_item_doc: ALAN_TOURING_OLD}198 eq_({c.id for c in solve(diff.datasources.qualifiers_added, cache=cache)},199 set())200 eq_({c.id for c in solve(diff.datasources.qualifiers_removed,201 cache=cache)},202 set())203 eq_(solve(diff.qualifiers_added, cache=cache), 0)204 eq_(solve(diff.qualifiers_removed, cache=cache), 0)205 eq_(pickle.loads(pickle.dumps(diff.qualifiers_added)),206 diff.qualifiers_added)207 eq_(pickle.loads(pickle.dumps(diff.qualifiers_removed)),208 diff.qualifiers_removed)209def test_badges_diff():210 cache = {revision_item_doc: ALAN_TOURING,211 parent_item_doc: ALAN_TOURING_OLD}212 badges_diff = solve(diff.datasources.badges_diff, cache=cache)213 eq_(badges_diff.added, {'lawiki', 'aswiki', 'enwiki', 'ruwiki', 'azwiki'})214 eq_(badges_diff.removed, set())215 eq_(badges_diff.intersection, set())216 eq_(badges_diff.changed, set())217 eq_(badges_diff.unchanged, set())218 eq_(pickle.loads(pickle.dumps(diff.datasources.badges_diff)),219 diff.datasources.badges_diff)220 eq_(solve(diff.badges_added, cache=cache), 5)221 eq_(solve(diff.badges_removed, cache=cache), 0)222 eq_(solve(diff.badges_changed, cache=cache), 0)223 eq_(pickle.loads(pickle.dumps(diff.badges_added)), diff.badges_added)224 eq_(pickle.loads(pickle.dumps(diff.badges_removed)), diff.badges_removed)225 eq_(pickle.loads(pickle.dumps(diff.badges_changed)), diff.badges_changed)226def test_proportion_of_qid_added():227 cache = {revision_item_doc: ALAN_TOURING,228 parent_item_doc: ALAN_TOURING_OLD}229 eq_(round(solve(diff.proportion_of_qid_added, cache=cache), 2), 0.95)230 eq_(pickle.loads(pickle.dumps(diff.proportion_of_qid_added)),231 diff.proportion_of_qid_added)232def test_proportion_of_language_added():233 cache = {revision_item_doc: ALAN_TOURING,234 parent_item_doc: ALAN_TOURING_OLD}235 eq_(round(solve(diff.proportion_of_language_added, cache=cache), 2), 0.0)236 eq_(pickle.loads(pickle.dumps(diff.proportion_of_language_added)),237 diff.proportion_of_language_added)238def test_proportion_of_links_added():239 cache = {revision_item_doc: ALAN_TOURING,240 parent_item_doc: ALAN_TOURING_OLD}241 eq_(round(solve(diff.proportion_of_links_added, cache=cache), 2), 0.87)242 eq_(pickle.loads(pickle.dumps(diff.proportion_of_links_added)),243 diff.proportion_of_links_added)244def test_identifiers_changed():245 cache = {revision_item_doc: ALAN_TOURING,246 parent_item_doc: ALAN_TOURING_OLD}247 eq_(round(solve(diff.identifiers_changed, cache=cache), 2), 1)248 eq_(pickle.loads(pickle.dumps(diff.identifiers_changed)),249 diff.identifiers_changed)250def test_property_changed():251 p999_changed = diff.property_changed('P999')252 p19_changed = diff.property_changed('P19')253 cache = {revision_item_doc: ALAN_TOURING,254 parent_item_doc: ALAN_TOURING_OLD}255 eq_(solve(p999_changed, cache=cache), False)256 eq_(solve(p19_changed, cache=cache), True)257 eq_(pickle.loads(pickle.dumps(p999_changed)), p999_changed)...
mkwiki.py
Source:mkwiki.py
...221 conf = Config(plugins=BuiltinPluginManager())222 usage_text = conf.help(nose.main.__doc__).replace('mkwiki.py', 'nosetests')223 out = '{{{\n%s\n}}}\n' % usage_text224 return out225def mkwiki(path):226 #227 # Pages to publish and the docstring(s) to load for that page228 #229 pages = { #'SandBox': wikirst(section(nose.__doc__, 'Writing tests'))230 'WritingTests': wikirst(section(nose.__doc__, 'Writing tests')),231 'NoseFeatures': wikirst(section(nose.__doc__, 'Features')),232 'WritingPlugins': wikirst(nose.plugins.__doc__),233 'PluginInterface': plugin_interface(),234 'ErrorClassPlugin': wikirst(errorclass.__doc__),235 'TestingTools': tools(),236 'FindingAndRunningTests': wikirst(237 section(nose.__doc__, 'Finding and running tests')),238 # FIXME finish example plugin doc... add some explanation239 'ExamplePlugin': example_plugin(),240 241 'NosetestsUsage': usage(),242 }243 current = os.getcwd()244 w = Wiki(path)245 for page, doc in pages.items():246 print "====== %s ======" % page247 w.update_docs(page, doc)248 print "====== %s ======" % page249 os.chdir(current)250class Wiki(object):251 doc_re = re.compile(r'(.*?)' + div, re.DOTALL)252 253 def __init__(self, path):254 self.path = path255 self.newpages = []256 os.chdir(path)257 runcmd('svn up')258 def filename(self, page):259 if not page.endswith('.wiki'):260 page = page + '.wiki'261 return page262 263 def get_page(self, page):264 headers = []265 content = []266 try:267 fh = file(self.filename(page), 'r')268 in_header = True269 for line in fh:270 if in_header:271 if line.startswith('#'):272 headers.append(line)273 else:274 in_header = False275 content.append(line)276 else:277 content.append(line)278 fh.close() 279 return (headers, ''.join(content))280 except IOError:281 self.newpages.append(page)282 return ('', '')283 def set_docs(self, page, headers, page_src, docs):284 wikified = docs + div285 if not page_src:286 new_src = wikified + warning287 print "! Adding new page"288 else:289 m = self.doc_re.search(page_src)290 if m:291 print "! Updating doc section"292 new_src = self.doc_re.sub(wikified, page_src, 1)293 else:294 print "! Adding new doc section"295 new_src = wikified + page_src296 if new_src == page_src:297 print "! No changes"298 return 299 # Restore any headers (lines marked by # at start of file)300 if headers:301 new_src = ''.join(headers) + '\n' + new_src302 fh = file(self.filename(page), 'w')303 fh.write(new_src)304 fh.close()305 306 def update_docs(self, page, doc):307 headers, current = self.get_page(page)308 self.set_docs(page, headers, current, doc)309 if page in self.newpages:310 runcmd('svn add %s' % self.filename(page))311 312def findwiki(root):313 if not root or root is '/': # not likely to work on windows314 raise ValueError("wiki path not found")315 if not os.path.isdir(root):316 return findwiki(os.path.dirname(root))317 entries = os.listdir(root)318 if 'wiki' in entries:319 return os.path.join(root, 'wiki')320 return findwiki(os.path.dirname(root))321def main():322 path = findwiki(os.path.abspath(__file__))323 mkwiki(path)324 325if __name__ == '__main__':...
todb.py
Source:todb.py
1import pywikibot, os, re, json2import toolforge3from datetime import date, datetime, timedelta, timezone4from pytz import timezone56#os.chdir(r'projects/wpmed')78conn = toolforge.connect('frwiki_p','analytics')9connLabs = toolforge.connect_tools('s53143__mis_lists_p')10cursor1 = connLabs.cursor()1112utc_timezone = timezone("UTC")13lva_timezone = timezone("Europe/Riga")1415def utc_to_local(utc_dt):16 return utc_timezone.localize(utc_dt).astimezone(lva_timezone)17#1819sql_insert = 'INSERT INTO `entries` (`name`, `group_name`, `jsondata`,`last_upd`) VALUES (%s, %s, %s, %s)'2021wplist = set(['abwiki', 'acewiki', 'adywiki', 'afwiki', 'akwiki', 'amwiki', 'anwiki', 'angwiki', 'arwiki', 'arcwiki', 'arzwiki', 'aswiki', 'astwiki', 'atjwiki', 'avwiki', 'aywiki', 'azwiki', 'azbwiki', 'bawiki', 'barwiki', 'bclwiki', 'bewiki', 'be_x_oldwiki', 'bgwiki', 'bhwiki', 'biwiki', 'bjnwiki', 'bmwiki', 'bnwiki', 'bowiki', 'bpywiki', 'brwiki', 'bswiki', 'bugwiki', 'bxrwiki', 'cawiki', 'cbk_zamwiki', 'cdowiki', 'cewiki', 'cebwiki', 'chwiki', 'chrwiki', 'chywiki', 'ckbwiki', 'cowiki', 'crwiki', 'crhwiki', 'cswiki', 'csbwiki', 'cuwiki', 'cvwiki', 'cywiki', 'dawiki', 'dewiki', 'dinwiki', 'diqwiki', 'dsbwiki', 'dtywiki', 'dvwiki', 'dzwiki', 'eewiki', 'elwiki', 'emlwiki', 'test2wiki', 'enwiki', 'testwiki', 'simplewiki', 'eowiki', 'eswiki', 'etwiki', 'euwiki', 'extwiki', 'fawiki', 'ffwiki', 'fiwiki', 'fjwiki', 'fowiki', 'frwiki', 'frpwiki', 'frrwiki', 'furwiki', 'fywiki', 'gawiki', 'gagwiki', 'ganwiki', 'gdwiki', 'glwiki', 'glkwiki', 'gnwiki', 'gomwiki', 'gotwiki', 'alswiki', 'guwiki', 'gvwiki', 'hawiki', 'hakwiki', 'hawwiki', 'hewiki', 'hiwiki', 'hifwiki', 'hrwiki', 'hsbwiki', 'htwiki', 'huwiki', 'hywiki', 'iawiki', 'idwiki', 'iewiki', 'igwiki', 'ikwiki', 'ilowiki', 'iowiki', 'iswiki', 'itwiki', 'iuwiki', 'jawiki', 'jamwiki', 'jbowiki', 'jvwiki', 'kawiki', 'kaawiki', 'kabwiki', 'kbdwiki', 'kbpwiki', 'kgwiki', 'kiwiki', 'kkwiki', 'klwiki', 'kmwiki', 'knwiki', 'kowiki', 'koiwiki', 'krcwiki', 'kswiki', 'kshwiki', 'kuwiki', 'kvwiki', 'kwwiki', 'kywiki', 'lawiki', 'ladwiki', 'lbwiki', 'lbewiki', 'lezwiki', 'lgwiki', 'liwiki', 'lijwiki', 'lmowiki', 'lnwiki', 'lowiki', 'lrcwiki', 'ltwiki', 'ltgwiki', 'lvwiki', 'zh_classicalwiki', 'maiwiki', 'map_bmswiki', 'mdfwiki', 'mgwiki', 'mhrwiki', 'miwiki', 'minwiki', 'mkwiki', 'mlwiki', 'mnwiki', 'mrwiki', 'mrjwiki', 'mswiki', 'mtwiki', 'mwlwiki', 'mywiki', 'myvwiki', 'mznwiki', 'nawiki', 'nahwiki', 'zh_min_nanwiki', 'napwiki', 'nowiki', 'ndswiki', 'nds_nlwiki', 'newiki', 'newwiki', 'nlwiki', 'nnwiki', 'novwiki', 'nrmwiki', 'nsowiki', 'nvwiki', 'nywiki', 'ocwiki', 'olowiki', 'omwiki', 'orwiki', 'oswiki', 'pawiki', 'pagwiki', 'pamwiki', 'papwiki', 'pcdwiki', 'pdcwiki', 'pflwiki', 'piwiki', 'pihwiki', 'plwiki', 'pmswiki', 'pnbwiki', 'pntwiki', 'pswiki', 'ptwiki', 'quwiki', 'rmwiki', 'rmywiki', 'rnwiki', 'rowiki', 'roa_tarawiki', 'ruwiki', 'ruewiki', 'roa_rupwiki', 'rwwiki', 'sawiki', 'sahwiki', 'scwiki', 'scnwiki', 'scowiki', 'sdwiki', 'sewiki', 'sgwiki', 'bat_smgwiki', 'shwiki', 'siwiki', 'skwiki', 'slwiki', 'smwiki', 'snwiki', 'sowiki', 'sqwiki', 'srwiki', 'srnwiki', 'sswiki', 'stwiki', 'stqwiki', 'suwiki', 'svwiki', 'swwiki', 'szlwiki', 'tawiki', 'tcywiki', 'tewiki', 'tetwiki', 'tgwiki', 'thwiki', 'tiwiki', 'tkwiki', 'tlwiki', 'tnwiki', 'towiki', 'tpiwiki', 'trwiki', 'tswiki', 'ttwiki', 'tumwiki', 'twwiki', 'tywiki', 'tyvwiki', 'udmwiki', 'ugwiki', 'ukwiki', 'urwiki', 'uzwiki', 'vewiki', 'vecwiki', 'vepwiki', 'viwiki', 'vlswiki', 'vowiki', 'fiu_vrowiki', 'wawiki', 'warwiki', 'wowiki', 'wuuwiki', 'xalwiki', 'xhwiki', 'xmfwiki', 'yiwiki', 'yowiki', 'zh_yuewiki', 'zawiki', 'zeawiki', 'zhwiki', 'zuwiki'])2223inp = eval(open('wdapiRES-july.txt', 'r', encoding='utf-8').read())2425#'Q1707822': {'nlwiki': 'Syndroom van Pendred', 'enwiki': 'Pendred syndrome', 'cswiki': 'Pendredův syndrom', 'arwiki': 'Ù
تÙازÙ
Ø© بÙÙدرÙد', 'frwiki': 'Syndrome de Pendred', 'eswiki': 'SÃndrome de Pendred', 'fiwiki': 'Pendredin oireyhtymä', 'ruwiki': 'СиндÑом ÐендÑеда', 'plwiki': 'ZespóŠPendreda', 'dewiki': 'Pendred-Syndrom', 'itwiki': 'Sindrome di Pendred'}2627meta = {}2829def parse():30 for entry in inp:31 data = inp[entry]32 kopigas = len(set(data) & wplist)33 meta.update({entry:[kopigas,data['enwiki']]})3435bigm = {}3637for entry in inp:38 data = inp[entry]3940 for wiki in wplist:41 if wiki not in data:42 43 if wiki in bigm:44 bigm[wiki].append(entry)45 else:46 bigm[wiki] = [entry]47#48parse()4950final = {}5152print('starting')53for one in bigm:54 #print(one)55 thiswiki = [[f,meta[f][0],meta[f][1]] for f in bigm[one]]56 thiswiki = sorted(thiswiki, key = lambda x: (-x[1], x[2]))57 #final.update({one:thiswiki[:1500]})58 curr_time = utc_to_local(datetime.utcnow())59 dateforq1 = "{0:%Y%m%d%H%M%S}".format(curr_time)60 #print(dateforq1)61 62 #put_db(infobox,result_json,dateforq1)63 cursor1.execute(sql_insert, (one, 'medicine',str(json.dumps(thiswiki)),dateforq1))64 65connLabs.commit()66connLabs.close()67conn.close()68print('Done')69 7071#fileS = open('wdapiRES-july-rez.txt', 'w', encoding='utf-8')
...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!