Skip to content
Snippets Groups Projects
Select Git revision
  • 7b6e621c39986aa932c121b01b9b6a03d0ae3686
  • master default protected
  • pipeline
  • dev
  • quality
  • docs
  • issue-65
  • issue-30
  • issue-19
  • issue-28
  • 0.1.1
  • 0.1.0
12 results

admin.py

Blame
  • util.py 641 B
    """
    Common test utilities
    """
    import os
    
    
    def get_path(filename):
        """Returns the absolute path to a test file
    
        Parameters
        ----------
        filename : string
            Name of file in tests to get path to
    
        Returns
        -------
        stl_path : string
            The path to the file
        """
    
        # Check if the parent directory is tests (this is for Pycharm unittests)
        if os.path.basename(os.getcwd()) == "tests":
            # This is for Pycharm testing
            stl_path = filename
        else:
            # This is for the Gitlab testing
            stl_path = os.path.join(os.path.abspath(os.getcwd()), "tests", filename)
        return stl_path