@skip_unless_master is used to skip tests because on named release branches, most work happens leading up to the first release on the branch, and that is before the docs have been published. Tests that check readthedocs for the right doc page will fail during this time, and it's just a big distraction. Also, if we bork the docs, it's not the end of the world, and we can fix it easily, so this is a good tradeoff.
33 lines
984 B
Python
33 lines
984 B
Python
"""
|
|
Information about the release line of this Open edX code.
|
|
"""
|
|
|
|
import unittest
|
|
|
|
|
|
# The release line: an Open edX release name ("ficus"), or "master".
|
|
# This should always be "master" on the master branch, and will be changed
|
|
# manually when we start release-line branches, like open-release/ficus.master.
|
|
RELEASE_LINE = "master"
|
|
|
|
|
|
def doc_version():
|
|
"""The readthedocs.org version name used in documentation references.
|
|
|
|
Returns a short string like "latest" or "open-release-ficus.master".
|
|
"""
|
|
if RELEASE_LINE == "master":
|
|
return "latest"
|
|
else:
|
|
return "open-release-{}.master".format(RELEASE_LINE)
|
|
|
|
|
|
def skip_unless_master(func_or_class):
|
|
"""
|
|
Only run the decorated test for code on master or destined for master.
|
|
|
|
Use this to skip tests that we expect to fail on a named release branch.
|
|
Please use carefully!
|
|
"""
|
|
return unittest.skipUnless(RELEASE_LINE == "master", "Test often fails on named releases")(func_or_class)
|