This year we had a rental property that we fixed up but then put on the market for sale. How do we handle the cost of the repairs?

We rented the property for 6 months of which we only collected 3 months rent. Going to small claims for the balance including damages. After renovating we decided to sale rather than continue to rent. The property went under contract Jan 2018 so I'll handle the sale next year. I just need to know if I can deduct the cost of the renovation against the rents as a loss in 2017. Thanks