{"id":21029850,"url":"https://github.com/kitconcept/pytest-solr","last_synced_at":"2026-01-30T02:09:50.181Z","repository":{"id":17412898,"uuid":"81926057","full_name":"kitconcept/pytest-solr","owner":"kitconcept","description":"Solr fixtures for Pytest","archived":false,"fork":false,"pushed_at":"2023-08-23T09:19:26.000Z","size":124,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-11T12:11:34.861Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kitconcept.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-14T09:03:35.000Z","updated_at":"2021-11-21T12:41:20.000Z","dependencies_parsed_at":"2022-08-03T02:30:29.801Z","dependency_job_id":null,"html_url":"https://github.com/kitconcept/pytest-solr","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitconcept%2Fpytest-solr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitconcept%2Fpytest-solr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitconcept%2Fpytest-solr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitconcept%2Fpytest-solr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kitconcept","download_url":"https://codeload.github.com/kitconcept/pytest-solr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254330795,"owners_count":22053050,"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","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":[],"created_at":"2024-11-19T12:14:31.450Z","updated_at":"2026-01-30T02:09:50.143Z","avatar_url":"https://github.com/kitconcept.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":".. image:: https://github.com/kitconcept/pytest-solr/actions/workflows/tests.yml/badge.svg\n    :target: https://github.com/kitconcept/pytest-solr/actions/workflows/tests.yml\n\n.. image:: https://img.shields.io/pypi/v/pytest-solr.svg\n    :target: https://pypi.python.org/pypi/pytest-solr/\n    :alt: Latest Version\n\n.. image:: https://img.shields.io/pypi/status/pytest-solr.svg\n    :target: https://pypi.python.org/pypi/pytest-solr/\n    :alt: Egg Status\n\n.. image:: https://img.shields.io/pypi/l/pytest-solr.svg\n    :target: https://pypi.python.org/pypi/pytest-solr/\n    :alt: License\n\nSolr process and client fixtures for py.test.\n\n.. image:: https://raw.githubusercontent.com/kitconcept/pytest-solr/master/kitconcept.png\n   :alt: kitconcept\n   :target: https://kitconcept.com/\n\nIntroduction\n------------\n\npytest-solr is a pytest plugin for the Apache Solr search server.\nIt provides three pytest factories:\n\nsolr_process:\n  For starting and stopping the Solr server. This is session scoped.\n\nsolr_core:\n  For loading and unloading a Solr core configuration. This is module scoped.\n\nsolr:\n  For connecting to a Solr server during a test. This is function scoped.\n\n\nSolr Process\n^^^^^^^^^^^^\n\nThe solr_process factory starts and stops a the Solr process.\nAn existing Solr executable is required for this.\n\n'executable':\n  path to the Solr executable. Default value is 'downloads/solr-\u003cSOLR_VERSION\u003e/bin/solr'\n'host':\n  hostname where Solr runs. Default value is 'localhost'.\n'port':\n  port Solr uses. Default is value is '18983'.\n'core':\n  Solr core that is used. Default value is 'solr'.\n'timeout':\n  timeout to wait for Solr to start. Default value is '60' (seconds).\n\nExample::\n\n  from pytest_solr.factories import solr_process\n\n  solr_process = solr_process(\n    executable='solr-6.5.0/bin/solr',\n    host='localhost',\n    port=8983,\n    core='default',\n    version='6.5.0',\n    timeout=60\n  )\n\n\nSolr Core\n^^^^^^^^^\n\nThe solr_core factory adds and removes a Solr core configuration.\nIt expects two parameters, the Solr Process fixture name and the Solr core name.\n\n'solr_process_fixture_name':\n  String with the name of the Solr Process. This is a required parameter.\n'solr_core_name':\n  String with the name of the Solr core. Default value is 'default'.\n\nExample::\n\n  from pytest_solr.factories import solr_core\n\n  my_solr_core = solr_core('solr_process', 'my_solr_core')\n\n\nSolr\n^^^^\n\nThe Solr factory connects to Solr via pysolr.\nIt expects a single parameter, the Solr core fixture name.\n\n'solr_core_fixture_name':\n  String with the name of the Solr core. This is a required parameter.\n\nExample::\n\n  # -*- coding: utf-8 -*-\n  from pytest_solr.factories import solr_core\n  from pytest_solr.factories import solr\n\n  minimal = solr_core('solr_process', 'minimal')\n  solr = solr('minimal')\n\n  def test_exact_term_match(solr):\n      solr.add([{'id': '1', 'title': 'bananas'}])\n      assert 1 == solr.search('title:bananas').hits\n\nThe solr fixture can then be injected into the test function and used to add documents to solr or search for terms.\n\nSee the `pysolr documentation \u003chttps://github.com/django-haystack/pysolr\u003e`_. for more details.\n\n\nInstallation\n------------\n\nInstall pytest-solr with pip::\n\n  $ pip install pytest-solr\n\n\nUsage\n-----\n\nCreate a solr core with the name 'minimal' and inject the use the solr factory into a test function to use it::\n\n    # -*- coding: utf-8 -*-\n    from pytest_solr.factories import solr_core\n    from pytest_solr.factories import solr\n\n    minimal = solr_core('solr_process', 'minimal')\n    solr = solr('minimal')\n\n\n    def test_exact_term_match(solr):\n        solr.add([{'id': '1', 'title': 'bananas'}])\n        assert 1 == solr.search('title:bananas').hits\n\nLicense\n-------\n\nCopyright kitconcept GmbH.\n\nDistributed under the terms of the MIT license, pytest-solr is free and Open Source software.\n\n\nContribute\n----------\n\n- `Source code at Github \u003chttps://github.com/kitconcept/pytest-solr\u003e`_\n- `Issue tracker at Github \u003chttps://github.com/kitconcept/pytest-solr/issues\u003e`_\n\n\nSupport\n-------\n\nIf you are having issues, `please let us know \u003chttps://github.com/kitconcept/pytest-solr/issues\u003e`_. If you require professional support feel free to contact us at `info@kitconcept.com. \u003cmailto:info@kitconcept.com\u003e`_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitconcept%2Fpytest-solr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkitconcept%2Fpytest-solr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitconcept%2Fpytest-solr/lists"}