{"id":16512920,"url":"https://github.com/daskol/pytest-local","last_synced_at":"2025-07-29T14:11:42.097Z","repository":{"id":234124522,"uuid":"623259139","full_name":"daskol/pytest-local","owner":"daskol","description":"Simple forking server for testing with reusable context.","archived":false,"fork":false,"pushed_at":"2023-04-09T02:14:36.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-02T09:17:24.392Z","etag":null,"topics":["preloading","pytest","pytest-local","testing"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daskol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-04T02:35:07.000Z","updated_at":"2023-04-04T18:36:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"e4595222-b387-411d-a14e-3fbf69a33251","html_url":"https://github.com/daskol/pytest-local","commit_stats":{"total_commits":8,"total_committers":2,"mean_commits":4.0,"dds":0.125,"last_synced_commit":"fc6ff4031b089287ed5d52529e9286e947954c64"},"previous_names":["daskol/pytest-local"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/daskol/pytest-local","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daskol%2Fpytest-local","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daskol%2Fpytest-local/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daskol%2Fpytest-local/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daskol%2Fpytest-local/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daskol","download_url":"https://codeload.github.com/daskol/pytest-local/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daskol%2Fpytest-local/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267701312,"owners_count":24130449,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["preloading","pytest","pytest-local","testing"],"created_at":"2024-10-11T16:06:36.632Z","updated_at":"2025-07-29T14:11:42.062Z","avatar_url":"https://github.com/daskol.png","language":"Python","readme":"# LTest\n\n*Simple forking server for testing with reusable context*\n\n## Overview\n\n**ltest** is extremeply simple forking server based on PyTest for local\ntesting. The main goal of the project is to preload \"fat\" libraries like JAX or\nTensorFlow in execution context of PyTest. It is written from scratch with\nnaked Python standard library and, of course, [pytest][1].\n\nIt seems that it should be rewritten to use IPython kernel for better coherence\nwith Jupyter since a lot of machine learning practitioners and researchers use\nit for development and testing. So, IPython could reduce possible unexpected\nside effects.\n\n### Usage Example\n\nHere's an example usage of the `ltest` local PyTest server.\n\nSuppose you have a project that uses JAX and you want to run your tests with\nPyTest. However, importing JAX takes a significant amount of time, which slows\ndown your tests. To speed up your tests, you can use the PyTest testing server\nto preload JAX before running the tests.\n\nFirst, create a Python script that defines your PyTest tests. Here's an example.\n\n```python\n# simple_test.py\nimport jax, jax.numpy as jnp\nfrom numpy.testing import assert_array_equal\n\n\ndef test_jitting():\n    def mul2(xs):\n        return xs * 2\n    xs = jnp.ones(10)\n    ys = jax.jit(mul2)(xs)\n    assert_array_equal(2 * xs, ys)\n```\n\nNext, start the PyTest testing server.\n\n```shell\nltest -l -m jax\n```\n\nThis starts the testing server on the default interface `127.0.0.1` and port\n`7070` and preloads the `jax` package.\n\nFinally, run your tests using the client.\n\n```shell\nltest -- -s -v\n```\n\nThis sends a request to the testing server to run the PyTest tests. The `-s`\nand `-v` options after `--` are passted to PyTest and used to display output\nfrom the tests. The server responds with a JSON object that contains the exit\ncode of the tests.\n\n### Command Line Interface (CLI)\n\n#### Starting Server\n\n```shell\nltest -l -m preloaded_pkg -m another.preloaded.pkg\n```\n\n#### Run Test on Local Server\n\n```shell\nltest -- --co\n```\n\n#### Run Tests with Arguments on Local Server\n\n```shell\nltest -- -v --tb=full -m slow -- path/to/suite/my_test.py\n```\n\n[1]: https://github.com/pytest-dev/pytest.git\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaskol%2Fpytest-local","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaskol%2Fpytest-local","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaskol%2Fpytest-local/lists"}