indie-status-page/venv/lib/python3.11/site-packages/greenlet/tests/test_version.py
IndieStatusBot 902133edd3 feat: indie status page MVP -- FastAPI + SQLite
- 8 DB models (services, incidents, monitors, subscribers, etc.)
- Full CRUD API for services, incidents, monitors
- Public status page with live data
- Incident detail page with timeline
- API key authentication
- Uptime monitoring scheduler
- 13 tests passing
- TECHNICAL_DESIGN.md with full spec
2026-04-25 05:00:00 +00:00

46 lines
1.5 KiB
Python

#! /usr/bin/env python
import sys
import os
from unittest import TestCase as NonLeakingTestCase
import greenlet
# No reason to run this multiple times under leakchecks,
# it doesn't do anything.
class VersionTests(NonLeakingTestCase):
def test_version(self):
def find_dominating_file(name):
if os.path.exists(name):
return name
tried = []
here = os.path.abspath(os.path.dirname(__file__))
for i in range(10):
up = ['..'] * i
path = [here] + up + [name]
fname = os.path.join(*path)
fname = os.path.abspath(fname)
tried.append(fname)
if os.path.exists(fname):
return fname
raise AssertionError("Could not find file " + name + "; checked " + str(tried))
try:
setup_py = find_dominating_file('setup.py')
except AssertionError as e:
self.skipTest("Unable to find setup.py; must be out of tree. " + str(e))
invoke_setup = "%s %s --version" % (sys.executable, setup_py)
with os.popen(invoke_setup) as f:
sversion = f.read().strip()
if not sversion or not sversion[0].isdigit():
self.skipTest(
"setup.py --version did not return a version string "
"(likely a setuptools compatibility issue): "
+ repr(sversion[:80])
)
self.assertEqual(sversion, greenlet.__version__)